Update app.py
Browse files
app.py
CHANGED
@@ -274,35 +274,27 @@ def make_calendar_heatmap(df, title, year):
|
|
274 |
@lru_cache(maxsize=100)
|
275 |
def fetch_follower_data(username):
|
276 |
try:
|
277 |
-
#
|
278 |
-
#
|
279 |
-
|
280 |
-
|
281 |
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
data
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
date = today - relativedelta(months=11-i)
|
295 |
-
followers += random.randint(0, 10)
|
296 |
-
data.append({
|
297 |
-
"date": date.strftime("%Y-%m-%d"),
|
298 |
-
"followers": followers
|
299 |
-
})
|
300 |
-
|
301 |
-
return data
|
302 |
|
303 |
-
return
|
304 |
except Exception as e:
|
305 |
-
st.error(f"Error
|
306 |
return []
|
307 |
|
308 |
|
|
|
274 |
@lru_cache(maxsize=100)
|
275 |
def fetch_follower_data(username):
|
276 |
try:
|
277 |
+
# Generate fake data for demonstration purposes
|
278 |
+
# In a real implementation, this would make an API call to get actual follower data
|
279 |
+
import random
|
280 |
+
from dateutil.relativedelta import relativedelta
|
281 |
|
282 |
+
# Generate 12 months of fake data
|
283 |
+
today = datetime.now()
|
284 |
+
data = []
|
285 |
+
followers = random.randint(10, 100)
|
286 |
+
|
287 |
+
for i in range(12):
|
288 |
+
date = today - relativedelta(months=11-i)
|
289 |
+
followers += random.randint(0, 10)
|
290 |
+
data.append({
|
291 |
+
"date": date.strftime("%Y-%m-%d"),
|
292 |
+
"followers": followers
|
293 |
+
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
|
295 |
+
return data
|
296 |
except Exception as e:
|
297 |
+
st.error(f"Error generating follower data: {str(e)}")
|
298 |
return []
|
299 |
|
300 |
|