Created
January 28, 2013 01:05
-
-
Save askedrelic/4651871 to your computer and use it in GitHub Desktop.
top 20 most watched github repos across all languages
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
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