instatag/instatag.py
def user_list_gen(tag):
    '''
    This function extract user_list for each tag in first step and then run step_2_gen for second users
    :param tag: hastag
    :type tag:str
    :return: None
    '''
    try:
        hash_list = post_list_gen(tag)
        file=io.open("insta_data/users_1_"+tag+".txt","a",encoding="utf-8")
        user_list=[]
        for i in range(len(hash_list)):
            print("Code : "+hash_list[i])
            user_url = post_url_maker(hash_list[i])
            raw_html = get_html(user_url)
            raw_file=BeautifulSoup(raw_html,"html.parser").prettify()
            index = 0
            while(index!=-1):
                index=raw_file.find('"username":',index+13,len(raw_file))
                length=raw_file[index:].find('}')
                user=raw_file[index+12:index+length-1]
                if user[-1]=='"':
                    user=user[:-1]
                if len(user)<50 and (user not in user_list):
                    user_list.append(user)
                    user = user.encode("utf-8")
                    file.write(str(user,encoding="utf-8")+"\n")

        step_2_gen(user_list,tag)
        file.close()
    except Exception as ex:
        print(str(ex))
        instatag_help()
        step_2_gen(user_list, tag)

    This function extract user_list for each tag in first step and then run step_2_gen for second users
    :param tag: hastag
    :type tag:str
    :return: None
    
This function extract user_list for each tag in first step and then run step_2_gen for second users
This function extract user_list for each tag in first step and then run step_2_gen for second users
def user_list_gen(tag):
    try:
        hash_list = post_list_gen(tag)
        file=io.open("insta_data/users_1_"+tag+".txt","a",encoding="utf-8")
        user_list=[]
        for i in range(len(hash_list)):
            print("Code : "+hash_list[i])
            user_url = post_url_maker(hash_list[i])
            raw_html = get_html(user_url)
            raw_file=BeautifulSoup(raw_html,"html.parser").prettify()
            index = 0
            while(index!=-1):
                index=raw_file.find('"username":',index+13,len(raw_file))
                length=raw_file[index:].find('}')
                user=raw_file[index+12:index+length-1]
                if user[-1]=='"':
                    user=user[:-1]
                if len(user)<50 and (user not in user_list):
                    user_list.append(user)
                    user = user.encode("utf-8")
                    file.write(str(user,encoding="utf-8")+"\n")
        step_2_gen(user_list,tag)
        file.close()
    except Exception as ex:
        print(str(ex))
        instatag_help()
        step_2_gen(user_list, tag)
def user_list_gen ( tag ) : try : hash_list = post_list_gen ( tag ) file = io . open ( "insta_data/users_1_" + tag + ".txt" , "a" , encoding = "utf-8" ) user_list = [ ] for i in range ( len ( hash_list ) ) : print ( "Code : " + hash_list [ i ] ) user_url = post_url_maker ( hash_list [ i ] ) raw_html = get_html ( user_url ) raw_file = BeautifulSoup ( raw_html , "html.parser" ) . prettify ( ) index = 0 while ( index != - 1 ) : index = raw_file . find ( '"username":' , index + 13 , len ( raw_file ) ) length = raw_file [ index : ] . find ( '}' ) user = raw_file [ index + 12 : index + length - 1 ] if user [ - 1 ] == '"' : user = user [ : - 1 ] if len ( user ) < 50 and ( user not in user_list ) : user_list . append ( user ) user = user . encode ( "utf-8" ) file . write ( str ( user , encoding = "utf-8" ) + "\n" ) step_2_gen ( user_list , tag ) file . close ( ) except Exception as ex : print ( str ( ex ) ) instatag_help ( ) step_2_gen ( user_list , tag )
This function extract user_list for each tag in first step and then run step_2_gen for second users
This function extract user_list for each tag in first step and then run step_2_gen for second users
'''
    This function extract user_list for each tag in first step and then run step_2_gen for second users
    :param tag: hastag
    :type tag:str
    :return: None
    '''
None
tag
None