Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@ const https = require('node:https');
const fs = require('node:fs');
let data = '';

https.get('https://www.nicovideo.jp/ranking/genre/all?term=hour&rss=2.0&lang=ja-jp',
const apiEndpoint ='https://snapshot.search.nicovideo.jp/api/v2/snapshot/video/contents/search';
const search_keyword_param = 'q=ゲーム';
const search_targets_param = 'targets=tags';
const sort_param = '_sort=viewCounter';
const fields_param =
'fields=contentId,title,description,tags,viewCounter,mylistCounter,likeCounter,lengthSeconds,commentCounter';
const filters_param =
'filters[startTime][gte]=2025-05-13T00:00:00Z&filters[startTime][lte]=2025-05-13T23:59:59Z';
const limit_param = '_limit=5';

const apiRequestUrl = `${apiEndpoint}?${search_keyword_param}&${search_targets_param}&${sort_param}&${fields_param}&${filters_param}&${limit_param}`;

https.get(apiRequestUrl,
{
headers: {
'User-Agent': 'node',
Expand All @@ -16,9 +28,9 @@ https.get('https://www.nicovideo.jp/ranking/genre/all?term=hour&rss=2.0&lang=ja-
data += chunk;
})
.on('end', () => {

});
}
);

fs.writeFile('test.txt', data, 'utf8', () => {});
fs.writeFile('test.txt', data, 'utf8', () => {});