Skip to content

Instantly share code, notes, and snippets.

@resure
Created November 18, 2013 18:02
Show Gist options
  • Save resure/7532401 to your computer and use it in GitHub Desktop.
Save resure/7532401 to your computer and use it in GitHub Desktop.
wikidot_export.py
from xmlrpc.client import ServerProxy
import json
pages = []
wikidot = ServerProxy('https://username:api_key@scpfoundation.ru/xml-rpc-api.php')
pages_names = wikidot.pages.select({"site": "scp-ru"})
for page_name in pages_names:
p = wikidot.pages.get_one( { "site": "scp-ru", "page": page_name } )
del(p['html'])
pages.append(p)
print("Done: %s" % ( page_name ))
with open('scp-ru.json', 'w') as outfile:
json.dump(pages, outfile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment