From 032c577bb535106a3394882edb19eef46dfa0586 Mon Sep 17 00:00:00 2001 From: aurora1530 <35615953+aurora1530@users.noreply.github.com> Date: Sat, 25 Apr 2026 18:01:29 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=83=8B=E3=82=B3=E3=83=8B=E3=82=B3?= =?UTF-8?q?=E5=8B=95=E7=94=BB=E3=81=AE=E3=83=A9=E3=83=B3=E3=82=AD=E3=83=B3?= =?UTF-8?q?=E3=82=B0=E5=8F=96=E5=BE=97=E3=82=92RSS=E3=81=8B=E3=82=89API?= =?UTF-8?q?=E5=88=A9=E7=94=A8=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index ad67e03..9239713 100644 --- a/app.js +++ b/app.js @@ -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', @@ -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', () => {}); \ No newline at end of file +fs.writeFile('test.txt', data, 'utf8', () => {});