mylesai commited on
Commit
20b2f7f
·
verified ·
1 Parent(s): 07f4438

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -6,7 +6,7 @@ import os
6
  RAPIDAPI_API_KEY = os.environ['RAPIDAPI_API_KEY']
7
 
8
  def scrape_instagram(user_name):
9
-
10
  url = "https://instagram-scraper-api2.p.rapidapi.com/v1/info"
11
  print(user_name)
12
 
@@ -70,6 +70,7 @@ def get_insta_info(df):
70
  df['Date Joined'] = ''
71
 
72
  for index, row in df.iterrows():
 
73
  profile_info = scrape_instagram(row['Username'])
74
 
75
  if profile_info: # Only populate if profile_info is not empty
@@ -104,6 +105,7 @@ def scrape_linkedins(links):
104
  "x-rapidapi-user": "usama"
105
  }
106
 
 
107
  # Initialize an empty list to store the dictionaries
108
  profile_info_list = []
109
 
@@ -136,6 +138,9 @@ def scrape_linkedins(links):
136
  def get_LI_info(df):
137
  links = df['Links'].tolist()
138
  profile_info_list = scrape_linkedins(links)
 
 
 
139
 
140
  # Add new columns to the DataFrame
141
  df['Full Name'] = ''
 
6
  RAPIDAPI_API_KEY = os.environ['RAPIDAPI_API_KEY']
7
 
8
  def scrape_instagram(user_name):
9
+
10
  url = "https://instagram-scraper-api2.p.rapidapi.com/v1/info"
11
  print(user_name)
12
 
 
70
  df['Date Joined'] = ''
71
 
72
  for index, row in df.iterrows():
73
+ print(row['Username'])
74
  profile_info = scrape_instagram(row['Username'])
75
 
76
  if profile_info: # Only populate if profile_info is not empty
 
105
  "x-rapidapi-user": "usama"
106
  }
107
 
108
+
109
  # Initialize an empty list to store the dictionaries
110
  profile_info_list = []
111
 
 
138
  def get_LI_info(df):
139
  links = df['Links'].tolist()
140
  profile_info_list = scrape_linkedins(links)
141
+
142
+ # Create a dictionary for quick lookup based on the link
143
+ profile_info_dict = {info['link']: info for info in profile_info_list if info}
144
 
145
  # Add new columns to the DataFrame
146
  df['Full Name'] = ''