Skip to content

Instantly share code, notes, and snippets.

@matthewhughes
Created July 8, 2013 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewhughes/5947877 to your computer and use it in GitHub Desktop.
Save matthewhughes/5947877 to your computer and use it in GitHub Desktop.
Plurk Scraper 3
def search_plurk(argument):
plurks = plurk.callAPI('/APP/PlurkSearch/search', {'query' : argument})
rows = []
for p in plurks["plurks"]:
row = OrderedDict()
row['Plurk_ID'] = p["plurk_id"]
row['Owner_ID'] = p["owner_id"]
row['Verb'] = p["qualifier"]
row['Content'] = p["content"]
rows.append(row)
submit_to_scraperwiki(rows)
def submit_to_scraperwiki(rows):
scraperwiki.sqlite.save(["plurk_id"], rows, argument)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment