| @@ 81-102 (lines=22) @@ | ||
| 78 | :type page_number:int |
|
| 79 | :return: github star url as string |
|
| 80 | ''' |
|
| 81 | return "https://github.com/"+Name+"?page="+str(page_number)+"&tab=stars" |
|
| 82 | def repo_extract(input_string,username): |
|
| 83 | ''' |
|
| 84 | This function extract repo from raw_html |
|
| 85 | :param input_string: raw input html |
|
| 86 | :param user_name: user_name |
|
| 87 | :type input_string:str |
|
| 88 | :type user_name:str |
|
| 89 | :return: repo_list as list |
|
| 90 | ''' |
|
| 91 | try: |
|
| 92 | user_list=[] |
|
| 93 | index=0 |
|
| 94 | shift=len(username)+1 |
|
| 95 | while(index!=-1): |
|
| 96 | index=input_string.find('src="/'+username,index+shift,len(input_string)) |
|
| 97 | length=input_string[index:].find('graphs/') |
|
| 98 | star_repo=input_string[index+5:index+length] |
|
| 99 | if star_repo.find("<svg")==-1 and len(star_repo)!=0: |
|
| 100 | user_list.append(star_repo) |
|
| 101 | return user_list |
|
| 102 | except Exception as ex: |
|
| 103 | pass |
|
| 104 | ||
| 105 | def star_extract(input_string): |
|
| @@ 104-124 (lines=21) @@ | ||
| 101 | return user_list |
|
| 102 | except Exception as ex: |
|
| 103 | pass |
|
| 104 | ||
| 105 | def star_extract(input_string): |
|
| 106 | ''' |
|
| 107 | This function extract stared repo from raw_html |
|
| 108 | :param input_string: raw input html |
|
| 109 | :param follower_name: follower_name |
|
| 110 | :type input_string:str |
|
| 111 | :type follower_name:str |
|
| 112 | :return: user_list as list |
|
| 113 | ''' |
|
| 114 | user_list=[] |
|
| 115 | index=0 |
|
| 116 | try: |
|
| 117 | while(index!=-1): |
|
| 118 | index=input_string.find('<a class="muted-link mr-3',index+33,len(input_string)) |
|
| 119 | length=input_string[index+33:].find('stargazers">\n') |
|
| 120 | star_repo=input_string[index+34:index+33+length] |
|
| 121 | if star_repo.find("<svg")==-1 and len(star_repo)!=0: |
|
| 122 | user_list.append(star_repo) |
|
| 123 | return user_list |
|
| 124 | except Exception as ex: |
|
| 125 | pass |
|
| 126 | def org_list_gen(name): |
|
| 127 | url=url_maker_follower(name,1) |
|