Code Duplication    Length = 23-23 lines in 2 locations

gitfollow/gitfollow.py 2 locations

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