From 573f65184d9d3d2435f5fc33a4b85b34f4c49e6c Mon Sep 17 00:00:00 2001 From: Kiera Affarantia <74483226+MinazukiAmane@users.noreply.github.com> Date: Sat, 9 Mar 2024 04:59:18 +0700 Subject: [PATCH] add News Page --- pages/rest-api/News/_meta.json | 6 ++ .../rest-api/News/animenewsnetwork/_meta.json | 4 + .../animenewsnetwork/fetch-news-feeds.mdx | 100 ++++++++++++++++++ .../News/animenewsnetwork/fetch-news-info.mdx | 95 +++++++++++++++++ 4 files changed, 205 insertions(+) create mode 100644 pages/rest-api/News/_meta.json create mode 100644 pages/rest-api/News/animenewsnetwork/_meta.json create mode 100644 pages/rest-api/News/animenewsnetwork/fetch-news-feeds.mdx create mode 100644 pages/rest-api/News/animenewsnetwork/fetch-news-info.mdx diff --git a/pages/rest-api/News/_meta.json b/pages/rest-api/News/_meta.json new file mode 100644 index 0000000..7359e1e --- /dev/null +++ b/pages/rest-api/News/_meta.json @@ -0,0 +1,6 @@ +{ + "animenewsnetwork": { + "title": "AnimeNewsNetwork", + "theme": { "collapsed": true } + } + } \ No newline at end of file diff --git a/pages/rest-api/News/animenewsnetwork/_meta.json b/pages/rest-api/News/animenewsnetwork/_meta.json new file mode 100644 index 0000000..47a180e --- /dev/null +++ b/pages/rest-api/News/animenewsnetwork/_meta.json @@ -0,0 +1,4 @@ +{ + "fetch-news-feeds": "Fetch News Feeds", + "fetch-news-info": "Fetch News Info" + } \ No newline at end of file diff --git a/pages/rest-api/News/animenewsnetwork/fetch-news-feeds.mdx b/pages/rest-api/News/animenewsnetwork/fetch-news-feeds.mdx new file mode 100644 index 0000000..3309b6b --- /dev/null +++ b/pages/rest-api/News/animenewsnetwork/fetch-news-feeds.mdx @@ -0,0 +1,100 @@ +--- +title: Fetch News Feeds +--- + +import { Tab, Tabs } from "nextra-theme-docs"; + +# Fetch News Feeds + +Technical details regarding the usage of the fetch news feeds function for the ANN provider can be found below. Example code is provided for both JavaScript and Python, along with a response schema. + +## Route Schema (URL) + +``` +https://api.nganime.my.id/news/ann/recent-feeds +``` + +## Query Parameters + +| Parameter | Type | Description | Required? | Default | +| :-------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------------------------------- | :-------: | :-----: | +| topic | Enum:

`"anime"` `"animation"` `"manga"` `"games"` `"novels"` `"live-action"` `"covid-19"` `"industry"` `"music"` `"people"` `"merch"` `"events"` | This Controls the topic of the news that will be returned in the request. | No | N/A | + +## Request Samples + + + + <> + ```js + import axios from "axios"; + + // Example request using no paramters, which fetches all recent news. + const url = "https://api.nganime.my.id/news/ann/recent-feeds"; + const data = async () => { + try { + const { data } = await axios.get(url); + return data; + } catch (err) { + throw new Error(err.message); + } + }; + + console.log(data); + ``` + + + + + <> + ```python + import requests + + # Example request using no paramters, which fetches all recent news. + url = "https://api.nganime.my.id/news/ann/recent-feeds" + response = requests.get(url) + data = response.json() + + print(data) + ``` + + + + + +## Response Schema + + + + **MIME Type:** `application/json` + ```json copy=false + [ + { + "title": "string", + "id": "string", + "uploadedAt": "string", + "topics": [ + "string" + ], + "preview": { + "intro": "string", + "full": "string" + }, + "thumbnail": "string", + "url": "string" + }, + ] + ``` + + + **MIME Type:** `application/json` + ```json copy=false + "message": {} + ``` + + + **MIME Type:** `application/json` + ```json copy=false + "message": {} + ``` + + \ No newline at end of file diff --git a/pages/rest-api/News/animenewsnetwork/fetch-news-info.mdx b/pages/rest-api/News/animenewsnetwork/fetch-news-info.mdx new file mode 100644 index 0000000..f1adf36 --- /dev/null +++ b/pages/rest-api/News/animenewsnetwork/fetch-news-info.mdx @@ -0,0 +1,95 @@ +--- +title: Fetch News Info +--- + +import { Tab, Tabs } from "nextra-theme-docs"; + +# Fetch News Feeds + +Technical details regarding the usage of the fetch news info function for the ANN provider can be found below. Example code is provided for both JavaScript and Python, along with a response schema. + +## Route Schema (URL) + +``` +https://api.nganime.my.id/news/ann/info +``` + +## Query Parameters + +| Parameter | Type | Description | Required? | Default | +| :-------: | :----: | ----------------------------------------------------------------------- | :-------: | :-----: | +| id | string | This is the ID of the news story that will be returned in the function. | Yes | N/A | + +## Request Samples + + + + <> + ```js + import axios from "axios"; + + // An example news story about the Kindaichi Case Files ending. + const url = "https://api.nganime.my.id/news/ann/info?id=2023-04-26/kibo-no-chikara-~otona-precure-23~-anime-teaser-narrated-by-nozomi-yuko-sanpei/.197525"; + const data = async () => { + try { + const { data } = await axios.get(url); + return data; + } catch (err) { + throw new Error(err.message); + } + }; + + console.log(data); + ``` + + + + + <> + ```python + import requests + + # An example news story about the Kindaichi Case Files ending. + url = "https://api.nganime.my.id/news/ann/info?id=2023-04-26/kibo-no-chikara-~otona-precure-23~-anime-teaser-narrated-by-nozomi-yuko-sanpei/.197525" + response = requests.get(url) + data = response.json() + + print(data) + ``` + + + + + +## Response Schema + + + + **MIME Type:** `application/json` + ```json copy=false + [ + { + id: "string", + title: "string", + uploadedAt: "string", + intro: "string", + description: "string", + thumbnail: "string", + url: "string" + } + ] + ``` + + + **MIME Type:** `application/json` + ```json copy=false + "message": {} + ``` + + + **MIME Type:** `application/json` + ```json copy=false + "message": {} + ``` + + \ No newline at end of file