Exemplo n.º 1
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
Exemplo n.º 2
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