Example #1
0
def saveUserRepo(url):
	setProxy()
	soup = getSoup(getPage(url))
	repo_url_list = getRepoURLs(soup)
	for repo_url in repo_url_list:
		repo_url = 'https://github.com'+repo_url
		saveRepo(repo_url)
		print 'Repo Saved'
	return
Example #2
0
def searchGist(query):
    setProxy()
    pg_no = 0
    search_count = 0
    gist_dict={}

    while True:
        pg_no = getPageNumber(pg_no)
        soup = doSearch(pg_no, query)
        gist_dict, search_count_new = searchgists(soup, gist_dict, search_count)
        if search_count_new == search_count +1:
            break
        search_count = search_count_new
    
    gistReader(gist_dict)   
    return
Example #3
0
def saveRepo(url):
    global opener
    opener = urllib2.build_opener()
    urllib2.install_opener(opener)
    opener = setProxy()
    if url:
        mainRepoURL(url)
    return
Example #4
0
def searchRepo(query, language):
	setProxy()
	if language:
		language = language.capitalize()
	
	pg_no = 0
	search_count = 0
	repo_dict={}

	while True:
		pg_no = getPageNumber(pg_no)
		soup = searchPage(pg_no, query, language)
		repo_dict, search_count_new = searchResults(soup, repo_dict, search_count)
		if search_count_new == search_count:
			break
		search_count = search_count_new
	repoReader(repo_dict)
	return repo_dict
Example #5
0
def saveGist(url):
    setProxy()
    page = getPage(url)
    soup = getSoup(page)
    saveText(soup)