zhimin-z
commited on
Commit
·
b7cc227
1
Parent(s):
c014211
add
Browse files
msr.py
CHANGED
|
@@ -58,18 +58,18 @@ def scrape_marketplace_apps(category):
|
|
| 58 |
|
| 59 |
|
| 60 |
if __name__ == '__main__':
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
|
| 74 |
"""Commit and push changes to Hugging Face dataset."""
|
| 75 |
subprocess.run(['git', 'add', '.'], check=True)
|
|
|
|
| 58 |
|
| 59 |
|
| 60 |
if __name__ == '__main__':
|
| 61 |
+
for filename in os.listdir('.'):
|
| 62 |
+
if filename.endswith('.json'):
|
| 63 |
+
with open(filename) as f:
|
| 64 |
+
data = json.load(f)
|
| 65 |
+
if data.get('name') and not get_app_info(data['name']):
|
| 66 |
+
os.remove(filename)
|
| 67 |
|
| 68 |
+
for slug in scrape_marketplace_apps('ai-assisted'):
|
| 69 |
+
if app_info := get_app_info(slug):
|
| 70 |
+
with open(f'{slug}[bot].json', 'w', encoding='utf-8') as f:
|
| 71 |
+
json.dump(app_info, f, indent=4, ensure_ascii=False)
|
| 72 |
+
time.sleep(0.5)
|
| 73 |
|
| 74 |
"""Commit and push changes to Hugging Face dataset."""
|
| 75 |
subprocess.run(['git', 'add', '.'], check=True)
|