Update index.html
Browse files- index.html +6 -18
index.html
CHANGED
|
@@ -365,10 +365,10 @@
|
|
| 365 |
|
| 366 |
async loadSpaces() {
|
| 367 |
try {
|
| 368 |
-
console.log('Searching for spaces with
|
| 369 |
|
| 370 |
-
//
|
| 371 |
-
const response = await fetch(
|
| 372 |
|
| 373 |
if (!response.ok) {
|
| 374 |
throw new Error(`HTTP error! status: ${response.status}`);
|
|
@@ -377,27 +377,15 @@
|
|
| 377 |
const data = await response.json();
|
| 378 |
console.log('API response:', data.length, 'spaces found');
|
| 379 |
|
| 380 |
-
|
| 381 |
-
const exactTagSpaces = data.filter(space => {
|
| 382 |
-
const hasExactTag = space.tags && space.tags.includes(this.targetTag);
|
| 383 |
-
if (hasExactTag) {
|
| 384 |
-
console.log('Found space with reachy_mini tag:', space.id, 'tags:', space.tags);
|
| 385 |
-
}
|
| 386 |
-
return hasExactTag;
|
| 387 |
-
});
|
| 388 |
-
|
| 389 |
-
console.log('Spaces with exact reachy_mini tag:', exactTagSpaces.length);
|
| 390 |
-
|
| 391 |
-
this.spaces = exactTagSpaces.map(space => ({
|
| 392 |
id: space.id,
|
| 393 |
title: space.id.split('/').pop().replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase()),
|
| 394 |
author: space.author,
|
| 395 |
-
description: space.cardData?.short_description ||
|
| 396 |
likes: space.likes || 0,
|
| 397 |
created: new Date(space.createdAt).getTime(),
|
| 398 |
url: `https://huggingface.co/spaces/${space.id}`,
|
| 399 |
-
tags: space.tags || []
|
| 400 |
-
downloads: space.downloads || 0
|
| 401 |
}));
|
| 402 |
|
| 403 |
this.filteredSpaces = [...this.spaces];
|
|
|
|
| 365 |
|
| 366 |
async loadSpaces() {
|
| 367 |
try {
|
| 368 |
+
console.log('Searching for spaces with reachy_mini tag...');
|
| 369 |
|
| 370 |
+
// Search for spaces with the reachy_mini tag using filter parameter
|
| 371 |
+
const response = await fetch('https://huggingface.co/api/spaces?filter=reachy_mini&sort=likes&direction=-1&limit=50');
|
| 372 |
|
| 373 |
if (!response.ok) {
|
| 374 |
throw new Error(`HTTP error! status: ${response.status}`);
|
|
|
|
| 377 |
const data = await response.json();
|
| 378 |
console.log('API response:', data.length, 'spaces found');
|
| 379 |
|
| 380 |
+
this.spaces = data.map(space => ({
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 381 |
id: space.id,
|
| 382 |
title: space.id.split('/').pop().replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase()),
|
| 383 |
author: space.author,
|
| 384 |
+
description: space.cardData?.short_description || 'No description available',
|
| 385 |
likes: space.likes || 0,
|
| 386 |
created: new Date(space.createdAt).getTime(),
|
| 387 |
url: `https://huggingface.co/spaces/${space.id}`,
|
| 388 |
+
tags: space.tags || []
|
|
|
|
| 389 |
}));
|
| 390 |
|
| 391 |
this.filteredSpaces = [...this.spaces];
|