Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -88,23 +88,23 @@ async def api_test(ctx):
|
|
| 88 |
#row_values_2 = worksheet2.row_values(2)
|
| 89 |
|
| 90 |
for i, user in enumerate(column_values_3):
|
| 91 |
-
if not column_values_8[i]:
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
spaces = data["numSpaces"]
|
| 101 |
-
discussions = data["numDiscussions"]
|
| 102 |
-
papers = data["numPapers"]
|
| 103 |
-
upvotes = data["numUpvotes"]
|
| 104 |
-
|
| 105 |
-
worksheet2.update(values=[[likes, models, datasets, spaces, discussions, papers, upvotes]], range_name=f'G{i+1}:M{i+1}')
|
| 106 |
-
else:
|
| 107 |
-
print(f"Failed to retrieve data. Status code: {response.status_code}")
|
| 108 |
|
| 109 |
|
| 110 |
@bot.command(name='get_cell_value')
|
|
|
|
| 88 |
#row_values_2 = worksheet2.row_values(2)
|
| 89 |
|
| 90 |
for i, user in enumerate(column_values_3):
|
| 91 |
+
#if not column_values_8[i]:
|
| 92 |
+
url = f"https://huggingface.co/api/users/{user}/overview"
|
| 93 |
+
response = requests.get(url)
|
| 94 |
+
if response.status_code == 200:
|
| 95 |
+
data = response.json()
|
| 96 |
+
|
| 97 |
+
likes = data["numLikes"]
|
| 98 |
+
models = data["numModels"]
|
| 99 |
+
datasets = data["numDatasets"]
|
| 100 |
+
spaces = data["numSpaces"]
|
| 101 |
+
discussions = data["numDiscussions"]
|
| 102 |
+
papers = data["numPapers"]
|
| 103 |
+
upvotes = data["numUpvotes"]
|
| 104 |
|
| 105 |
+
worksheet2.update(values=[[likes, models, datasets, spaces, discussions, papers, upvotes]], range_name=f'G{i+1}:M{i+1}')
|
| 106 |
+
else:
|
| 107 |
+
print(f"Failed to retrieve data. Status code: {response.status_code}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
|
| 110 |
@bot.command(name='get_cell_value')
|