Skip to content

Instantly share code, notes, and snippets.

@RhinosF1
Last active June 9, 2020 22:57
Show Gist options
  • Save RhinosF1/18c83dfbfadb84e28ee083628c029b41 to your computer and use it in GitHub Desktop.
Save RhinosF1/18c83dfbfadb84e28ee083628c029b41 to your computer and use it in GitHub Desktop.
This script will create a list of apis for all public miraheze.org wikis.
import requests
S = requests.Session()
URL = "https://meta.miraheze.org/w/api.php"
PARAMS = {
"action": "wikidiscover",
"format": "json",
"wdstate": "public",
"wdsiteprop": "url"
}
R = S.get(url=URL, params=PARAMS)
DATA = R.json()
data = DATA['wikidiscover']
ld = len(data)
x = 0
while x < ld:
wikidata = data[x]
wikidata = wikidata['url']
print(str(wikidata) + '/w/api.php')
x = x + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment