Created
June 9, 2012 13:01
-
-
Save timf/2900907 to your computer and use it in GitHub Desktop.
Use the long ID number in a Tweet URL as script argument
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 python | |
import json | |
import urllib | |
import sys | |
if len(sys.argv) < 2: | |
sys.exit('Usage: %s [Tweet ID #]' % sys.argv[0]) | |
url = "http://api.twitter.com/1/statuses/show/%s.json" % sys.argv[1] | |
response = urllib.urlopen(url) | |
jsontxt = response.read() | |
print json.dumps(json.loads(jsontxt), sort_keys=True, indent=4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment