Skip to content

Instantly share code, notes, and snippets.

@sauravtom
Created September 16, 2014 18:48
Show Gist options
  • Save sauravtom/bae63219ab02d8fd954b to your computer and use it in GitHub Desktop.
Save sauravtom/bae63219ab02d8fd954b to your computer and use it in GitHub Desktop.
Python script to generate a list of top 100 subreddits
#!/usr/bin/env python
import json
import requests
def main():
arr = requests.get("http://www.reddit.com/reddits.json?limit=1000").json()['data']['children']
arr = [i['data']['display_name'] for i in arr]
f=open('subreddits.json','w')
f.write(json.dumps(arr))
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment