Created
November 1, 2010 19:05
-
-
Save sjl/658689 to your computer and use it in GitHub Desktop.
A command-line client for A Feed Apart
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
import json, time, urllib | |
n = 0 | |
while 1: | |
try: | |
resp = json.load(urllib.urlopen('http://afeedapart.com/u/%s' % n)) | |
except ValueError: | |
time.sleep(1) | |
continue | |
n = resp['current'] | |
for tweet in (i['content'] for i in resp['items'] if i['type'] == 'tweet'): | |
print u'@%s: %s' % (tweet['user']['screen_name'], tweet['text']) | |
print '-' * 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
meow