Skip to content

Instantly share code, notes, and snippets.

@cybojanek
Last active December 21, 2015 17:59
Show Gist options
  • Save cybojanek/6344085 to your computer and use it in GitHub Desktop.
Save cybojanek/6344085 to your computer and use it in GitHub Desktop.
import csv
import urllib
import urllib2
args = {
"title": "Special:Ask",
"p[format]": "csv",
"order_num": "ASC",
"p[limit]": "100",
"eq": ["yes", "yes"],
"po": "?Description\r\n?parent\r\n?Since\r\n?Removed\r\n",
"q": "[[Category:Functions]]\r\n[[parent::~love.*]]\r\n[[parent::!~*(*]]"
}
e_args = urllib.urlencode(args)
req = urllib2.Request("http://www.love2d.org/wiki/Special:Ask", e_args)
csv_data = urllib2.urlopen(req).readlines()
# CSV parse it
data = list(csv.reader(csv_data, delimiter=",", quotechar="\""))
print data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment