Skip to content

Instantly share code, notes, and snippets.

@matthewhughes
Created July 8, 2013 10:52
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/5947862 to your computer and use it in GitHub Desktop.
Save matthewhughes/5947862 to your computer and use it in GitHub Desktop.
Plurk Scraper 2
def main():
try:
if len(sys.argv) != 2:
raise InvalidArgumentError("Please supply a single argument. An example would be 'kittens'")
else:
search_plurk(argument)
except Exception, e:
scraperwiki.status('error', type(e).__name__)
print json.dumps({
'error': {
'type': type(e).__name__,
'message': str(e),
'trace': traceback.format_exc()
}
})
else:
scraperwiki.status('ok')
print json.dumps({
'success': {
'type': 'ok',
'message': "Searched Plurk"
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment