Created
November 26, 2017 01:55
-
-
Save LongHairedHacker/012dd526bf6f619780abe4ee2f6adced to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import requests | |
import mwparserfromhell | |
import pypandoc | |
def main(): | |
resp = requests.get("https://events.ccc.de/congress/2017/wiki/index.php?title=Assembly:CSOC&action=raw") | |
wikicode = mwparserfromhell.parse(resp.text) | |
properties = {param.name : param.value for param in wikicode.filter_templates()[0].params} | |
print properties | |
output = pypandoc.convert_text(resp.text, 'html', format='mediawiki') | |
print output | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment