Skip to content

Instantly share code, notes, and snippets.

@askedrelic
Created January 28, 2013 01:05
Show Gist options
  • Save askedrelic/4651871 to your computer and use it in GitHub Desktop.
Save askedrelic/4651871 to your computer and use it in GitHub Desktop.
top 20 most watched github repos across all languages
import requests
import re
popular_repos = []
lang_page = requests.get('https://github.com/languages')
popular_langs = list(set(re.findall('href="/languages/(.*?)"', lang_page.content)))
for lang in popular_langs:
most_watched_lang_page = requests.get('https://github.com/languages/{0}/most_watched'.format(lang))
repos = list(set([x for x in re.findall('href="/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)', most_watched_lang_page.content) if 'languages' not in x[0]]))
print lang
print repos
for x in repos:
popular_repos.append(x)
uniq_popular_repos = sorted((set(popular_repos)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment