Skip to content

Instantly share code, notes, and snippets.

@desg
Created January 24, 2013 06:22
Show Gist options
  • Save desg/4618102 to your computer and use it in GitHub Desktop.
Save desg/4618102 to your computer and use it in GitHub Desktop.
import requests
import time
def getReddit(subreddit):
baseurl = requests.get("http://reddit.com/r/%s/new/.json" % str(subreddit))
jsonData = baseurl.json()['data']['children']
return jsonData
known_title = "wheres waldo"
posts = 1
seen_id = set()
while True:
reddit = getReddit('all')
for posts in range(0,3):
seen_id.add(reddit[posts]['data']['id'])
print seen_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment