Created
May 17, 2014 02:47
-
-
Save d6e/950ec7a2af2b2a79bff5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 python | |
''' | |
In case you forget, this script is for generating a list of all netrunner cards | |
to be used in some plugin Anthony wants to use on stimhack. | |
''' | |
import requests | |
import io | |
filename = 'links.txt' | |
f = io.open(filename, 'w', encoding='utf8') | |
r = requests.get("http://netrunnerdb.com/api/cards/") | |
cards = r.json() | |
for card in cards: | |
k = ''.join([card['title']," => <a href=\'",card['url'],"'>",card['title'],"</a>\n"]) | |
f.write(k) | |
f.close() | |
''' | |
Examples: | |
Noise => <a href='http://netrunnerdb.com/en/card/01001'>Noise</a> | |
Emergency Shutdown => <a href='http://netrunnerdb.com/en/card/02043'>Emergency Shutdown</a> | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment