mylesai commited on
Commit
aaadc48
·
verified ·
1 Parent(s): 03578c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -2,6 +2,7 @@ import requests
2
  import pandas as pd
3
  import gradio as gr
4
  import os
 
5
 
6
  RAPIDAPI_API_KEY = os.environ['RAPIDAPI_API_KEY']
7
 
@@ -69,7 +70,7 @@ def get_insta_info(df):
69
  df['Country'] = ''
70
  df['Date Joined'] = ''
71
 
72
- def get_insta_info(df):
73
  # Add new columns to the DataFrame
74
  df['Bio'] = ''
75
  df['Follower Count'] = 0
@@ -90,7 +91,8 @@ def get_insta_info(df):
90
  links = df['Links'].values
91
  print(links)
92
 
93
- for i in range(len(links)):
 
94
  profile_info = scrape_instagram(links[i])
95
 
96
  if profile_info: # Only populate if profile_info is not empty
@@ -157,7 +159,7 @@ def scrape_linkedins(links):
157
  return profile_info_list
158
 
159
  # Function to populate DataFrame with LinkedIn information
160
- def get_LI_info(df):
161
  links = df['Links'].tolist()
162
  profile_info_list = scrape_linkedins(links)
163
 
@@ -177,7 +179,7 @@ def get_LI_info(df):
177
  df['All Education'] = ''
178
 
179
  # Populate the DataFrame by matching the Link values
180
- for index, row in df.iterrows():
181
  link = row['Links']
182
  if link in profile_info_dict:
183
  profile_info = profile_info_dict[link]
 
2
  import pandas as pd
3
  import gradio as gr
4
  import os
5
+ import time
6
 
7
  RAPIDAPI_API_KEY = os.environ['RAPIDAPI_API_KEY']
8
 
 
70
  df['Country'] = ''
71
  df['Date Joined'] = ''
72
 
73
+ def get_insta_info(df, progress=gr.Progress()):
74
  # Add new columns to the DataFrame
75
  df['Bio'] = ''
76
  df['Follower Count'] = 0
 
91
  links = df['Links'].values
92
  print(links)
93
 
94
+ for i in progress.tqdm(range(len(links)), desc='Scraping...'):
95
+ time.sleep(1)
96
  profile_info = scrape_instagram(links[i])
97
 
98
  if profile_info: # Only populate if profile_info is not empty
 
159
  return profile_info_list
160
 
161
  # Function to populate DataFrame with LinkedIn information
162
+ def get_LI_info(df, progress=gr.Progress()):
163
  links = df['Links'].tolist()
164
  profile_info_list = scrape_linkedins(links)
165
 
 
179
  df['All Education'] = ''
180
 
181
  # Populate the DataFrame by matching the Link values
182
+ for index, row in progress.tqdm(df.iterrows(), desc='Scraping...'):
183
  link = row['Links']
184
  if link in profile_info_dict:
185
  profile_info = profile_info_dict[link]