From f6fb66ab82b5b761c41e065ae5c9ba3b42d7ab26 Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Wed, 31 Mar 2021 15:20:44 -0400 Subject: [PATCH 1/6] update to ignore swp file from vim --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 684fdbbf..0788fbd6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules package-lock.json cookie.txt +*.swp From 2e562c0f2ccba47a4775d47d16a3c2b51af66860 Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Wed, 31 Mar 2021 15:45:57 -0400 Subject: [PATCH 2/6] update to require node-fetch module --- autogenerator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/autogenerator.py b/autogenerator.py index 913e1ad0..b4083e2a 100644 --- a/autogenerator.py +++ b/autogenerator.py @@ -110,6 +110,7 @@ def make_javascript_file(): else: code.code = [] code.write('//This file is autogenerated. See modules.json and autogenerator.py for details\n\n') + code.write('const fetch = require("node-fetch")\n\n') code.write('/*\n') code.indent() code.write(javascript_file_name + '\n\n') From 329c7f4313783bac4e86dc307a954eb82b62c12f Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Wed, 31 Mar 2021 17:14:35 -0400 Subject: [PATCH 3/6] update to require node-fetch --- javascript/all_messages.js | 2 ++ javascript/check_token.js | 2 ++ javascript/compare.js | 2 ++ javascript/expand_templates.js | 2 ++ javascript/file_archive.js | 2 ++ javascript/file_repo_info.js | 2 ++ javascript/general_site_info.js | 2 ++ javascript/get_extlinks.js | 2 ++ javascript/get_feed_recent_changes.js | 2 ++ javascript/get_file_usage.js | 2 ++ javascript/get_help.js | 2 ++ javascript/get_transcluded_in.js | 2 ++ javascript/get_user_contributions_feed.js | 2 ++ javascript/get_user_watchlist_feed.js | 2 ++ javascript/iwbacklinks.js | 2 ++ javascript/langbacklinks.js | 2 ++ javascript/langlinks.js | 2 ++ javascript/linkshere.js | 2 ++ javascript/main_module.js | 2 ++ javascript/opensearch.js | 2 ++ javascript/pageprops.js | 2 ++ javascript/paraminfo.js | 2 ++ javascript/rsd.js | 2 ++ javascript/templates.js | 2 ++ javascript/userinfo.js | 2 ++ 25 files changed, 50 insertions(+) diff --git a/javascript/all_messages.js b/javascript/all_messages.js index d6cfdedd..f27d4939 100644 --- a/javascript/all_messages.js +++ b/javascript/all_messages.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* all_messages.js diff --git a/javascript/check_token.js b/javascript/check_token.js index 9c14e97b..4f2ac4a8 100644 --- a/javascript/check_token.js +++ b/javascript/check_token.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* check_token.js diff --git a/javascript/compare.js b/javascript/compare.js index 3e4c8656..a036c07f 100644 --- a/javascript/compare.js +++ b/javascript/compare.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* compare.js diff --git a/javascript/expand_templates.js b/javascript/expand_templates.js index 36b60dca..458a21ea 100644 --- a/javascript/expand_templates.js +++ b/javascript/expand_templates.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* expand_templates.js diff --git a/javascript/file_archive.js b/javascript/file_archive.js index 39cc0edf..b3075bba 100644 --- a/javascript/file_archive.js +++ b/javascript/file_archive.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* file_archive.js diff --git a/javascript/file_repo_info.js b/javascript/file_repo_info.js index 070ff4db..f31b4bf5 100644 --- a/javascript/file_repo_info.js +++ b/javascript/file_repo_info.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* file_repo_info.js diff --git a/javascript/general_site_info.js b/javascript/general_site_info.js index f193c176..2dbd2bc5 100644 --- a/javascript/general_site_info.js +++ b/javascript/general_site_info.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* general_site_info.js diff --git a/javascript/get_extlinks.js b/javascript/get_extlinks.js index 9aea86bb..1cf375e0 100644 --- a/javascript/get_extlinks.js +++ b/javascript/get_extlinks.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* get_extlinks.js diff --git a/javascript/get_feed_recent_changes.js b/javascript/get_feed_recent_changes.js index f6149e38..02cbb755 100644 --- a/javascript/get_feed_recent_changes.js +++ b/javascript/get_feed_recent_changes.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* get_feed_recent_changes.js diff --git a/javascript/get_file_usage.js b/javascript/get_file_usage.js index d06a2ab3..88d84303 100644 --- a/javascript/get_file_usage.js +++ b/javascript/get_file_usage.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* get_file_usage.js diff --git a/javascript/get_help.js b/javascript/get_help.js index 56baee62..573c9cc7 100644 --- a/javascript/get_help.js +++ b/javascript/get_help.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* get_help.js diff --git a/javascript/get_transcluded_in.js b/javascript/get_transcluded_in.js index af1220c0..46cd8454 100644 --- a/javascript/get_transcluded_in.js +++ b/javascript/get_transcluded_in.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* get_transcluded_in.js diff --git a/javascript/get_user_contributions_feed.js b/javascript/get_user_contributions_feed.js index 36c3dd1a..69af5ad2 100644 --- a/javascript/get_user_contributions_feed.js +++ b/javascript/get_user_contributions_feed.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* get_user_contributions_feed.js diff --git a/javascript/get_user_watchlist_feed.js b/javascript/get_user_watchlist_feed.js index 3b07d38a..11329624 100644 --- a/javascript/get_user_watchlist_feed.js +++ b/javascript/get_user_watchlist_feed.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* get_user_watchlist_feed.js diff --git a/javascript/iwbacklinks.js b/javascript/iwbacklinks.js index e54ffe08..2d05e0e7 100644 --- a/javascript/iwbacklinks.js +++ b/javascript/iwbacklinks.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* iwbacklinks.js diff --git a/javascript/langbacklinks.js b/javascript/langbacklinks.js index f103f659..a6cd32e4 100644 --- a/javascript/langbacklinks.js +++ b/javascript/langbacklinks.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* langbacklinks.js diff --git a/javascript/langlinks.js b/javascript/langlinks.js index 4ae90c6c..f962e3b3 100644 --- a/javascript/langlinks.js +++ b/javascript/langlinks.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* langlinks.js diff --git a/javascript/linkshere.js b/javascript/linkshere.js index cfe4ccaf..cf212af2 100644 --- a/javascript/linkshere.js +++ b/javascript/linkshere.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* linkshere.js diff --git a/javascript/main_module.js b/javascript/main_module.js index bcfc03b3..f5059b4d 100644 --- a/javascript/main_module.js +++ b/javascript/main_module.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* main_module.js diff --git a/javascript/opensearch.js b/javascript/opensearch.js index 8df72122..0bead856 100644 --- a/javascript/opensearch.js +++ b/javascript/opensearch.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* opensearch.js diff --git a/javascript/pageprops.js b/javascript/pageprops.js index 2187b39d..2f9b6fdf 100644 --- a/javascript/pageprops.js +++ b/javascript/pageprops.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* pageprops.js diff --git a/javascript/paraminfo.js b/javascript/paraminfo.js index 1900edd1..dd9a940e 100644 --- a/javascript/paraminfo.js +++ b/javascript/paraminfo.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* paraminfo.js diff --git a/javascript/rsd.js b/javascript/rsd.js index 6dfcf916..ea536337 100644 --- a/javascript/rsd.js +++ b/javascript/rsd.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* rsd.js diff --git a/javascript/templates.js b/javascript/templates.js index 34025c3d..2b7c802d 100644 --- a/javascript/templates.js +++ b/javascript/templates.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* templates.js diff --git a/javascript/userinfo.js b/javascript/userinfo.js index 01d0177a..17cda7a6 100644 --- a/javascript/userinfo.js +++ b/javascript/userinfo.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require("node-fetch") + /* userinfo.js From f4e7a651f1b72703037074edd12e8fed482bb4df Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Wed, 31 Mar 2021 17:48:46 -0400 Subject: [PATCH 4/6] add require node-fetch for these files --- javascript/duplicate_files.js | 2 ++ javascript/filearchive.js | 2 ++ javascript/geocoordinates.js | 2 ++ javascript/geoimagesearch.js | 2 ++ javascript/geosearch.js | 2 ++ javascript/get_allcategories.js | 2 ++ javascript/get_alldeletedrevs.js | 2 ++ javascript/get_allfileusages.js | 2 ++ javascript/get_allimages_by_date.js | 2 ++ javascript/get_allimages_by_name.js | 2 ++ javascript/get_alllinks.js | 2 ++ javascript/get_allpages.js | 2 ++ javascript/get_allredirects.js | 2 ++ javascript/get_allrevisions.js | 2 ++ javascript/get_alltransclusions.js | 2 ++ javascript/get_allusers.js | 2 ++ javascript/get_backlinks.js | 2 ++ javascript/get_blocked_users.js | 2 ++ javascript/get_categories.js | 2 ++ javascript/get_category_info.js | 2 ++ javascript/get_category_items.js | 2 ++ javascript/get_contributors.js | 2 ++ javascript/get_embedded_pages.js | 2 ++ javascript/get_exturlusage.js | 2 ++ javascript/get_filtered_page_revisions.js | 2 ++ javascript/get_imageinfo.js | 2 ++ javascript/get_imageusage.js | 2 ++ javascript/get_info.js | 2 ++ javascript/get_iwlinks.js | 2 ++ javascript/get_links.js | 2 ++ javascript/get_logevents.js | 2 ++ javascript/get_page_images.js | 2 ++ javascript/get_pagepropnames.js | 2 ++ javascript/get_pages_revisions.js | 2 ++ javascript/get_pageswithprop.js | 2 ++ javascript/get_protectedtitles.js | 2 ++ javascript/get_querypage_list.js | 2 ++ javascript/get_random.js | 2 ++ javascript/get_recent_category_items.js | 2 ++ javascript/get_recent_changes.js | 2 ++ javascript/get_red_links.js | 2 ++ javascript/get_redirects.js | 2 ++ javascript/get_subcategories.js | 2 ++ javascript/get_tags.js | 2 ++ javascript/get_usercontribs.js | 2 ++ javascript/get_users.js | 2 ++ javascript/languagesearch.js | 2 ++ javascript/parse.js | 2 ++ javascript/prefixsearch.js | 2 ++ javascript/search.js | 2 ++ 50 files changed, 100 insertions(+) diff --git a/javascript/duplicate_files.js b/javascript/duplicate_files.js index 0c2a6a42..f4303845 100644 --- a/javascript/duplicate_files.js +++ b/javascript/duplicate_files.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* duplicate_files.js diff --git a/javascript/filearchive.js b/javascript/filearchive.js index d2b2add9..cc73412a 100644 --- a/javascript/filearchive.js +++ b/javascript/filearchive.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* filearchive.js diff --git a/javascript/geocoordinates.js b/javascript/geocoordinates.js index 5447534f..a56600f8 100644 --- a/javascript/geocoordinates.js +++ b/javascript/geocoordinates.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* geocoordinates.js diff --git a/javascript/geoimagesearch.js b/javascript/geoimagesearch.js index 5fa65d31..d258ad48 100644 --- a/javascript/geoimagesearch.js +++ b/javascript/geoimagesearch.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* geoimagesearch.js diff --git a/javascript/geosearch.js b/javascript/geosearch.js index 2597b8e3..9842d36b 100644 --- a/javascript/geosearch.js +++ b/javascript/geosearch.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* geosearch.js diff --git a/javascript/get_allcategories.js b/javascript/get_allcategories.js index a6e2fefd..f3859a54 100644 --- a/javascript/get_allcategories.js +++ b/javascript/get_allcategories.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_allcategories.js diff --git a/javascript/get_alldeletedrevs.js b/javascript/get_alldeletedrevs.js index c7c71024..2ec19cd8 100644 --- a/javascript/get_alldeletedrevs.js +++ b/javascript/get_alldeletedrevs.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_alldeletedrevs.js diff --git a/javascript/get_allfileusages.js b/javascript/get_allfileusages.js index cd876a84..9acb01f3 100644 --- a/javascript/get_allfileusages.js +++ b/javascript/get_allfileusages.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_allfileusages.js diff --git a/javascript/get_allimages_by_date.js b/javascript/get_allimages_by_date.js index 09d29e1b..7abb1d9e 100644 --- a/javascript/get_allimages_by_date.js +++ b/javascript/get_allimages_by_date.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_allimages_by_date.js diff --git a/javascript/get_allimages_by_name.js b/javascript/get_allimages_by_name.js index 458ee8a8..b6f8b89a 100644 --- a/javascript/get_allimages_by_name.js +++ b/javascript/get_allimages_by_name.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_allimages_by_name.js diff --git a/javascript/get_alllinks.js b/javascript/get_alllinks.js index 8988e1f8..9c8602af 100644 --- a/javascript/get_alllinks.js +++ b/javascript/get_alllinks.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_alllinks.js diff --git a/javascript/get_allpages.js b/javascript/get_allpages.js index 04e688e6..4b8a6541 100644 --- a/javascript/get_allpages.js +++ b/javascript/get_allpages.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_allpages.js diff --git a/javascript/get_allredirects.js b/javascript/get_allredirects.js index e659c973..d7ca2cbd 100644 --- a/javascript/get_allredirects.js +++ b/javascript/get_allredirects.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_allredirects.js diff --git a/javascript/get_allrevisions.js b/javascript/get_allrevisions.js index 504600e0..de19e679 100644 --- a/javascript/get_allrevisions.js +++ b/javascript/get_allrevisions.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_allrevisions.js diff --git a/javascript/get_alltransclusions.js b/javascript/get_alltransclusions.js index 0eb83aca..94918557 100644 --- a/javascript/get_alltransclusions.js +++ b/javascript/get_alltransclusions.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_alltransclusions.js diff --git a/javascript/get_allusers.js b/javascript/get_allusers.js index b6ca249b..37933bd2 100644 --- a/javascript/get_allusers.js +++ b/javascript/get_allusers.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_allusers.js diff --git a/javascript/get_backlinks.js b/javascript/get_backlinks.js index aec1106d..d8505dfa 100644 --- a/javascript/get_backlinks.js +++ b/javascript/get_backlinks.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_backlinks.js diff --git a/javascript/get_blocked_users.js b/javascript/get_blocked_users.js index b687753d..ed5fa423 100644 --- a/javascript/get_blocked_users.js +++ b/javascript/get_blocked_users.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_blocked_users.js diff --git a/javascript/get_categories.js b/javascript/get_categories.js index 35fd5dcb..0e15b851 100644 --- a/javascript/get_categories.js +++ b/javascript/get_categories.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_categories.js diff --git a/javascript/get_category_info.js b/javascript/get_category_info.js index 8cb0668b..756e0dea 100644 --- a/javascript/get_category_info.js +++ b/javascript/get_category_info.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_category_items.js diff --git a/javascript/get_category_items.js b/javascript/get_category_items.js index 085d8abe..faf8132d 100644 --- a/javascript/get_category_items.js +++ b/javascript/get_category_items.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_category_items.js diff --git a/javascript/get_contributors.js b/javascript/get_contributors.js index 11d12ebc..15dc2129 100644 --- a/javascript/get_contributors.js +++ b/javascript/get_contributors.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_contributors.js diff --git a/javascript/get_embedded_pages.js b/javascript/get_embedded_pages.js index 4f51dadb..831f0b52 100644 --- a/javascript/get_embedded_pages.js +++ b/javascript/get_embedded_pages.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_embedded_pages.js diff --git a/javascript/get_exturlusage.js b/javascript/get_exturlusage.js index 2506bd5f..82e54468 100644 --- a/javascript/get_exturlusage.js +++ b/javascript/get_exturlusage.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_exturlusage.js diff --git a/javascript/get_filtered_page_revisions.js b/javascript/get_filtered_page_revisions.js index 65669e85..e3dd9fc7 100644 --- a/javascript/get_filtered_page_revisions.js +++ b/javascript/get_filtered_page_revisions.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_filtered_page_revisions.js diff --git a/javascript/get_imageinfo.js b/javascript/get_imageinfo.js index 657e95a5..60f13207 100644 --- a/javascript/get_imageinfo.js +++ b/javascript/get_imageinfo.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_imageinfo.js diff --git a/javascript/get_imageusage.js b/javascript/get_imageusage.js index 70fe8263..afca494d 100644 --- a/javascript/get_imageusage.js +++ b/javascript/get_imageusage.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_imageusage.js diff --git a/javascript/get_info.js b/javascript/get_info.js index 9764b44c..e02e7c8c 100644 --- a/javascript/get_info.js +++ b/javascript/get_info.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_info.js diff --git a/javascript/get_iwlinks.js b/javascript/get_iwlinks.js index 01ea7bfc..0ad3d980 100644 --- a/javascript/get_iwlinks.js +++ b/javascript/get_iwlinks.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_iwlinks.js diff --git a/javascript/get_links.js b/javascript/get_links.js index f74260c3..d3f29cea 100644 --- a/javascript/get_links.js +++ b/javascript/get_links.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_links.js diff --git a/javascript/get_logevents.js b/javascript/get_logevents.js index 56602187..a8cf5eaf 100644 --- a/javascript/get_logevents.js +++ b/javascript/get_logevents.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_logevents.js diff --git a/javascript/get_page_images.js b/javascript/get_page_images.js index 60438420..9b4842f6 100644 --- a/javascript/get_page_images.js +++ b/javascript/get_page_images.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_page_images.js diff --git a/javascript/get_pagepropnames.js b/javascript/get_pagepropnames.js index c654dfe4..b04f8e81 100644 --- a/javascript/get_pagepropnames.js +++ b/javascript/get_pagepropnames.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_pagepropnames.js diff --git a/javascript/get_pages_revisions.js b/javascript/get_pages_revisions.js index df18858e..2ef5b869 100644 --- a/javascript/get_pages_revisions.js +++ b/javascript/get_pages_revisions.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_pages_revisions.js diff --git a/javascript/get_pageswithprop.js b/javascript/get_pageswithprop.js index 17519d1c..dcf938a6 100644 --- a/javascript/get_pageswithprop.js +++ b/javascript/get_pageswithprop.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_pageswithprops.js diff --git a/javascript/get_protectedtitles.js b/javascript/get_protectedtitles.js index f9a42246..416c3302 100644 --- a/javascript/get_protectedtitles.js +++ b/javascript/get_protectedtitles.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_protectedtitles.js diff --git a/javascript/get_querypage_list.js b/javascript/get_querypage_list.js index 0f67649e..2f08929a 100644 --- a/javascript/get_querypage_list.js +++ b/javascript/get_querypage_list.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_querypage_list.js diff --git a/javascript/get_random.js b/javascript/get_random.js index 792ef6ff..0d74533a 100644 --- a/javascript/get_random.js +++ b/javascript/get_random.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_random.js diff --git a/javascript/get_recent_category_items.js b/javascript/get_recent_category_items.js index 932f5f7c..24ef2f13 100644 --- a/javascript/get_recent_category_items.js +++ b/javascript/get_recent_category_items.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_recent_category_items.js diff --git a/javascript/get_recent_changes.js b/javascript/get_recent_changes.js index a76a036f..da417d88 100644 --- a/javascript/get_recent_changes.js +++ b/javascript/get_recent_changes.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_recent_changes.js diff --git a/javascript/get_red_links.js b/javascript/get_red_links.js index b3363386..d794fff9 100644 --- a/javascript/get_red_links.js +++ b/javascript/get_red_links.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_red_links.js diff --git a/javascript/get_redirects.js b/javascript/get_redirects.js index 353ab4ce..90c4ce42 100644 --- a/javascript/get_redirects.js +++ b/javascript/get_redirects.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_redirects.js diff --git a/javascript/get_subcategories.js b/javascript/get_subcategories.js index 88d7fb7a..60236926 100644 --- a/javascript/get_subcategories.js +++ b/javascript/get_subcategories.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_subcategories.js diff --git a/javascript/get_tags.js b/javascript/get_tags.js index fb3cd397..03cd0cb8 100644 --- a/javascript/get_tags.js +++ b/javascript/get_tags.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_tags.js diff --git a/javascript/get_usercontribs.js b/javascript/get_usercontribs.js index 96950213..29e4994a 100644 --- a/javascript/get_usercontribs.js +++ b/javascript/get_usercontribs.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_usercontribs.js diff --git a/javascript/get_users.js b/javascript/get_users.js index 6ce742d2..aca572fe 100644 --- a/javascript/get_users.js +++ b/javascript/get_users.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* get_users.js diff --git a/javascript/languagesearch.js b/javascript/languagesearch.js index 084a2455..9f5ddb7e 100644 --- a/javascript/languagesearch.js +++ b/javascript/languagesearch.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* languagesearch.js diff --git a/javascript/parse.js b/javascript/parse.js index e1cd235a..dc1ccd62 100644 --- a/javascript/parse.js +++ b/javascript/parse.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* parse.js diff --git a/javascript/prefixsearch.js b/javascript/prefixsearch.js index daed61d3..ff126047 100644 --- a/javascript/prefixsearch.js +++ b/javascript/prefixsearch.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* prefixsearch.js diff --git a/javascript/search.js b/javascript/search.js index 453a39b3..a78532e2 100644 --- a/javascript/search.js +++ b/javascript/search.js @@ -1,5 +1,7 @@ //This file is autogenerated. See modules.json and autogenerator.py for details +const fetch = require('node-fetch'); + /* search.js From b4e940e0b7eec32c18da2539b52fcdbeb8c1aabc Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Wed, 31 Mar 2021 18:02:40 -0400 Subject: [PATCH 5/6] add the ending ; to keep them align with other changes --- autogenerator.py | 2 +- javascript/all_messages.js | 2 +- javascript/check_token.js | 2 +- javascript/compare.js | 2 +- javascript/expand_templates.js | 2 +- javascript/file_archive.js | 2 +- javascript/file_repo_info.js | 2 +- javascript/general_site_info.js | 2 +- javascript/get_extlinks.js | 2 +- javascript/get_feed_recent_changes.js | 2 +- javascript/get_file_usage.js | 2 +- javascript/get_help.js | 2 +- javascript/get_transcluded_in.js | 2 +- javascript/get_user_contributions_feed.js | 2 +- javascript/get_user_watchlist_feed.js | 2 +- javascript/iwbacklinks.js | 2 +- javascript/langbacklinks.js | 2 +- javascript/langlinks.js | 2 +- javascript/linkshere.js | 2 +- javascript/main_module.js | 2 +- javascript/opensearch.js | 2 +- javascript/pageprops.js | 2 +- javascript/paraminfo.js | 2 +- javascript/rsd.js | 2 +- javascript/templates.js | 2 +- javascript/userinfo.js | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/autogenerator.py b/autogenerator.py index b4083e2a..3a674464 100644 --- a/autogenerator.py +++ b/autogenerator.py @@ -110,7 +110,7 @@ def make_javascript_file(): else: code.code = [] code.write('//This file is autogenerated. See modules.json and autogenerator.py for details\n\n') - code.write('const fetch = require("node-fetch")\n\n') + code.write('const fetch = require("node-fetch");\n\n') code.write('/*\n') code.indent() code.write(javascript_file_name + '\n\n') diff --git a/javascript/all_messages.js b/javascript/all_messages.js index f27d4939..8c9562b5 100644 --- a/javascript/all_messages.js +++ b/javascript/all_messages.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* all_messages.js diff --git a/javascript/check_token.js b/javascript/check_token.js index 4f2ac4a8..2269ee20 100644 --- a/javascript/check_token.js +++ b/javascript/check_token.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* check_token.js diff --git a/javascript/compare.js b/javascript/compare.js index a036c07f..72a5bebf 100644 --- a/javascript/compare.js +++ b/javascript/compare.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* compare.js diff --git a/javascript/expand_templates.js b/javascript/expand_templates.js index 458a21ea..02c128fb 100644 --- a/javascript/expand_templates.js +++ b/javascript/expand_templates.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* expand_templates.js diff --git a/javascript/file_archive.js b/javascript/file_archive.js index b3075bba..e8929e0c 100644 --- a/javascript/file_archive.js +++ b/javascript/file_archive.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* file_archive.js diff --git a/javascript/file_repo_info.js b/javascript/file_repo_info.js index f31b4bf5..4cb9f32d 100644 --- a/javascript/file_repo_info.js +++ b/javascript/file_repo_info.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* file_repo_info.js diff --git a/javascript/general_site_info.js b/javascript/general_site_info.js index 2dbd2bc5..ab5be913 100644 --- a/javascript/general_site_info.js +++ b/javascript/general_site_info.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* general_site_info.js diff --git a/javascript/get_extlinks.js b/javascript/get_extlinks.js index 1cf375e0..4a6da354 100644 --- a/javascript/get_extlinks.js +++ b/javascript/get_extlinks.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* get_extlinks.js diff --git a/javascript/get_feed_recent_changes.js b/javascript/get_feed_recent_changes.js index 02cbb755..0e36d91b 100644 --- a/javascript/get_feed_recent_changes.js +++ b/javascript/get_feed_recent_changes.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* get_feed_recent_changes.js diff --git a/javascript/get_file_usage.js b/javascript/get_file_usage.js index 88d84303..459f4ed7 100644 --- a/javascript/get_file_usage.js +++ b/javascript/get_file_usage.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* get_file_usage.js diff --git a/javascript/get_help.js b/javascript/get_help.js index 573c9cc7..33b8fb60 100644 --- a/javascript/get_help.js +++ b/javascript/get_help.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* get_help.js diff --git a/javascript/get_transcluded_in.js b/javascript/get_transcluded_in.js index 46cd8454..875eda98 100644 --- a/javascript/get_transcluded_in.js +++ b/javascript/get_transcluded_in.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* get_transcluded_in.js diff --git a/javascript/get_user_contributions_feed.js b/javascript/get_user_contributions_feed.js index 69af5ad2..e3d64009 100644 --- a/javascript/get_user_contributions_feed.js +++ b/javascript/get_user_contributions_feed.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* get_user_contributions_feed.js diff --git a/javascript/get_user_watchlist_feed.js b/javascript/get_user_watchlist_feed.js index 11329624..e061870c 100644 --- a/javascript/get_user_watchlist_feed.js +++ b/javascript/get_user_watchlist_feed.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* get_user_watchlist_feed.js diff --git a/javascript/iwbacklinks.js b/javascript/iwbacklinks.js index 2d05e0e7..f0cbeb58 100644 --- a/javascript/iwbacklinks.js +++ b/javascript/iwbacklinks.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* iwbacklinks.js diff --git a/javascript/langbacklinks.js b/javascript/langbacklinks.js index a6cd32e4..01a07cb6 100644 --- a/javascript/langbacklinks.js +++ b/javascript/langbacklinks.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* langbacklinks.js diff --git a/javascript/langlinks.js b/javascript/langlinks.js index f962e3b3..7f495a75 100644 --- a/javascript/langlinks.js +++ b/javascript/langlinks.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* langlinks.js diff --git a/javascript/linkshere.js b/javascript/linkshere.js index cf212af2..4efefba4 100644 --- a/javascript/linkshere.js +++ b/javascript/linkshere.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* linkshere.js diff --git a/javascript/main_module.js b/javascript/main_module.js index f5059b4d..6957c253 100644 --- a/javascript/main_module.js +++ b/javascript/main_module.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* main_module.js diff --git a/javascript/opensearch.js b/javascript/opensearch.js index 0bead856..c7aff5ca 100644 --- a/javascript/opensearch.js +++ b/javascript/opensearch.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* opensearch.js diff --git a/javascript/pageprops.js b/javascript/pageprops.js index 2f9b6fdf..9bea8e42 100644 --- a/javascript/pageprops.js +++ b/javascript/pageprops.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* pageprops.js diff --git a/javascript/paraminfo.js b/javascript/paraminfo.js index dd9a940e..7cd9c936 100644 --- a/javascript/paraminfo.js +++ b/javascript/paraminfo.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* paraminfo.js diff --git a/javascript/rsd.js b/javascript/rsd.js index ea536337..38503339 100644 --- a/javascript/rsd.js +++ b/javascript/rsd.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* rsd.js diff --git a/javascript/templates.js b/javascript/templates.js index 2b7c802d..700eaba9 100644 --- a/javascript/templates.js +++ b/javascript/templates.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* templates.js diff --git a/javascript/userinfo.js b/javascript/userinfo.js index 17cda7a6..080feb8e 100644 --- a/javascript/userinfo.js +++ b/javascript/userinfo.js @@ -1,6 +1,6 @@ //This file is autogenerated. See modules.json and autogenerator.py for details -const fetch = require("node-fetch") +const fetch = require("node-fetch"); /* userinfo.js From 160bbe379b03f0b0b0a7491e4c9cbc3fcef5cf66 Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Wed, 31 Mar 2021 19:33:40 -0400 Subject: [PATCH 6/6] re-write the opensearch using got.js --- javascript-got/opensearch.js | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 javascript-got/opensearch.js diff --git a/javascript-got/opensearch.js b/javascript-got/opensearch.js new file mode 100644 index 00000000..b0dee2aa --- /dev/null +++ b/javascript-got/opensearch.js @@ -0,0 +1,40 @@ + +const got = require("got"); + +/* + opensearch.js + + MediaWiki API Demos + Demo of `Opensearch` module: Search the wiki and obtain + results in an OpenSearch (http://www.opensearch.org) format + + MIT License +*/ + +var url = "https://en.wikipedia.org/w/api.php"; + + +async function opensearch(url, searchTerm) { + + var params = { + action: "opensearch", + search: searchTerm, + limit: "5", + namespace: "0", + format: "json" + }; + + try { + + const response = await got(url, { + searchParams: params + }).json() + + console.log( response ); + } catch( error ) { + console.log( error.response.body ); + } +} + + +opensearch(url, "Hampi");