Spaces:
Paused
Paused
Update handlers/search-catalog.js
Browse files- handlers/search-catalog.js +9 -21
handlers/search-catalog.js
CHANGED
|
@@ -1,22 +1,10 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
const response = await axios.get('https://archive.org/services/search/v1/scrape', {
|
| 9 |
-
params: {
|
| 10 |
-
count: 100,
|
| 11 |
-
sorts: 'num_reviews desc,avg_rating desc',
|
| 12 |
-
fields: 'avg_rating,creator,date,description,genre,identifier,language,subject,title,type',
|
| 13 |
-
q: query // No license parameter here
|
| 14 |
-
}
|
| 15 |
-
});
|
| 16 |
-
|
| 17 |
-
console.log('Search Results:', response.data);
|
| 18 |
-
return response.data;
|
| 19 |
-
} catch (error) {
|
| 20 |
-
console.error('Error in searchCatalog:', error.message);
|
| 21 |
-
}
|
| 22 |
-
};
|
|
|
|
| 1 |
+
// handlers/index.js
|
| 2 |
+
const searchCatalog = require('./search-catalog');
|
| 3 |
+
const getMeta = require('./get-meta');
|
| 4 |
+
const getStreams = require('./get-streams');
|
| 5 |
|
| 6 |
+
module.exports = (dependencies) => ({
|
| 7 |
+
searchCatalog: searchCatalog(dependencies),
|
| 8 |
+
getMeta: getMeta(dependencies),
|
| 9 |
+
getStreams: getStreams(dependencies),
|
| 10 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|