Closed Nandaka closed 9 years ago
Should the end JSON look like this example:
{
type: "Light novel",
language: "English",
titles: [
Zero_No_Tsukaima,
Date_A_Live
]
}
It is better to add the actual title too, not only the page id (the wiki page with _) as sometimes there are multiple alias/redirect to the same page title.
{
type: "Light novel",
language: "English",
titles: [
{ "Zero_No_Tsukaima": "Zero no Tsukaima" },
{ "Date_A_Live" : "Date a Live" }
]
}
or with data structure for easy parsing.
{
type: "Light novel",
language: "English",
titles: [
{ page: "Zero_No_Tsukaima", title: "Zero no Tsukaima" },
{ page: "Date_A_Live", title: "Date a Live" }
]
}
Should both options be present at the same time or would one be optional?
No, just provide either one. It is better to have standardized api.
Personally, I prefer the 2nd one.
I've done both, but to keep things simple for the 2nd one, it only provides the types available for a particular language, or the languages available for a particular type, which the application can then plug back into the original API.
Found the wiki api for this one: http://www.baka-tsuki.org/project/api.php?action=query&prop=info|revisions&generator=categorymembers&gcmlimit=500&gcmtype=page&format=json&gcmtitle=Category:Light_novel_(English)
it got the actual pageid and the lastrevid, which is good for checking any for updates...
do you want to call to this api and transform it to given format?
Thanks. I was wondering how could we get the last revised date... May I know can the pageid be utilised? I think I will switch the type&lang url to this one for the lastrevid.
last revised date
use the timestamp from the revision node
pageid
should use it, as the page title might be changed, but the id will not.
For the last revised date, is it relative to the server or?
it is using zulu timezone or in other word UTC+0
"timestamp": "2014-09-28T05:53:12Z"
if possible, use the same format.
I think I will preserve the timestamp and leave it to the dev to parse it according to their liking.
http://btapi-shadowys.ngapp.io/api/category?type=LIGHT_NOVEL&language=ARABIC
Need an API to fetch the list of novels based on the language and the type.
First you need to get the language category (or you can hardcoded it) http://www.baka-tsuki.org/project/index.php?title=Category:Language
For the type, I think you can hard-coded to:
Then you can get the light novel list from the page: http://www.baka-tsuki.org/project/index.php?title=Category:Teaser_(English)
Special notes on original novel: http://www.baka-tsuki.org/project/index.php?title=Category:Original_novel