| @@ 252-274 (lines=23) @@ | ||
| 249 | error_log("Error In Page " + str(page_number) + " Repos Page") |
|
| 250 | repo_list(username,page_number,counter+1) |
|
| 251 | def star_list(username,page_number=0,counter=0): |
|
| 252 | ''' |
|
| 253 | This function return stared_repo list |
|
| 254 | :param username: username |
|
| 255 | :type username:str |
|
| 256 | :return: stared repo as list |
|
| 257 | ''' |
|
| 258 | try: |
|
| 259 | star_list_temp=[] |
|
| 260 | while (True): |
|
| 261 | page_number += 1 |
|
| 262 | star_url = url_maker_star(username, page_number) |
|
| 263 | star_html = get_html(star_url) |
|
| 264 | temp_list = star_extract(star_html) |
|
| 265 | if len(temp_list)==0: |
|
| 266 | break |
|
| 267 | star_list_temp.extend(temp_list) |
|
| 268 | return star_list_temp |
|
| 269 | except Exception as ex: |
|
| 270 | if counter>3: |
|
| 271 | sys.exit() |
|
| 272 | error_log("Error In Page " + str(page_number) + " Stars Page") |
|
| 273 | star_list(username,page_number,counter+1) |
|
| 274 | ||
| 275 | def following_list_gen(follower_name,page_number=0,counter=0): |
|
| 276 | ''' |
|
| 277 | This function generate following list |
|
| @@ 182-204 (lines=23) @@ | ||
| 179 | if internet()==True: |
|
| 180 | new_session=requests.session() |
|
| 181 | new_session.cookies.clear() |
|
| 182 | raw_html=new_session.get(url) |
|
| 183 | new_session.close() |
|
| 184 | raw_data=raw_html.text |
|
| 185 | if "Not Found" in raw_data: |
|
| 186 | print("Invalid Github User") |
|
| 187 | sys.exit() |
|
| 188 | return raw_data |
|
| 189 | else: |
|
| 190 | print("Error In Internet") |
|
| 191 | pass |
|
| 192 | ||
| 193 | ||
| 194 | def end_check(input_string): |
|
| 195 | ''' |
|
| 196 | This function check end page |
|
| 197 | :param input_string: raw html |
|
| 198 | :type input_string:str |
|
| 199 | :return: True or False |
|
| 200 | ''' |
|
| 201 | if input_string.find("reached the end")!=-1: |
|
| 202 | return True |
|
| 203 | else: |
|
| 204 | return False |
|
| 205 | def follower_list_gen(follower_name,page_number=0,counter=0): |
|
| 206 | ''' |
|
| 207 | This function generate follower_list |
|