Baka-Tsuki API discussion (Dev)

Forum for volunteer developers working on Baka-Tsuki related applications (Baka-Reader, BTprince, etc).

Moderators: thelastguardian, Fringe Security Bureau, Senior Editors, Senior Translators, Alt. Language Translator/Editor, Executive Council, Project Translators, Project Editors

Post Reply
animeout
Kyonist
Posts: 18
Joined: Thu Feb 13, 2014 7:45 am
Favourite Light Novel:

Baka-Tsuki API discussion (Dev)

Post by animeout »

Hey guys

I personally wanted some help as I feel mediawiki's API is quite not so organised to use, maybe coz I have always used a structured REST API in all my projects. As such, I thought to make a more easier and clean to use API (which I want to use and act as a bridge in the iOS app dev I talked about) and wanted some help since I am not to used to Wiki nodes and mediawiki.

So I created this thread for people who are interested in this simple php based API and the followup iOS app development or might just want to contribute their knowledge of the API or just the wiki itself to this thread.
I am still checking out the MW API and so I will add the problems and things I feel stuck or confused on as a list to discuss on to the main post (this) itself

P#1 Getting list of Novels/Pages available in a category
This is the very basic and first step which is to get a list of available translated Novels rather pages from a Category.
Probably the most convenient page to fetch this list from would be http://www.baka-tsuki.org/project/index ... _(English)
The things that are needed from that page are the list of novels/pages in that category, preferably their title and page_id. I think if we can get the pageid along with page title for each novel, it would be great since the title itself can change which can break the API depending on this but pageid will remain same even if page is moved or renamed

P#2 Getting list of Volumes/Chapters available in a LN/Page
This is driving me nuts, unfortunately the Chapter pages of a novel aren't member-categories of the novel category it seems and thus the API doesnt return that in same way as P#1
I am having hard time understanding how or which module the chapter pages are or are they just linked as page links to actual chapter within a LN page ? If such then it seems fetching chapter page details per LN would be impossible unless we parse the html content of LN page or search/regex through all pages with the LN's actual title and then filter them into volumes/chapters

##Still checking out the API to find more things I might get stuck on
animeout
Kyonist
Posts: 18
Joined: Thu Feb 13, 2014 7:45 am
Favourite Light Novel:

Re: Baka-Tsuki API discussion (Dev)

Post by animeout »

animeout wrote: P#1 Getting list of Novels/Pages available in a category
This is the very basic and first step which is to get a list of available translated Novels rather pages from a Category.
Probably the most convenient page to fetch this list from would be http://www.baka-tsuki.org/project/index ... _(English)
The things that are needed from that page are the list of novels/pages in that category, preferably their title and page_id. I think if we can get the pageid along with page title for each novel, it would be great since the title itself can change which can break the API depending on this but pageid will remain same even if page is moved or renamed
[/b]
Seems after some research found the proper API call to do this
It would be by using categorymembers module to list the sub-categories under a parent category, actual call is something like this:

Code: Select all

http://baka-tsuki.org/project/api.php?action=query&list=categorymembers&cmtitle=Category:Light_novel_(English)&cmlimit=100&indexpageids&format=json
Unfortunately the same is not working for this, anyone has any idea on this ?
P#2 Getting list of Volumes/Chapters available in a LN/Page
This is driving me nuts, unfortunately the Chapter pages of a novel aren't member-categories of the novel category it seems and thus the API doesnt return that in same way as P#1
I am having hard time understanding how or which module the chapter pages are or are they just linked as page links to actual chapter within a LN page ? If such then it seems fetching chapter page details per LN would be impossible unless we parse the html content of LN page or search/regex through all pages with the LN's actual title and then filter them into volumes/chapters
Last edited by denormative on Tue Feb 18, 2014 4:13 pm, edited 1 time in total.
Reason: Added code tag so that api link is non-broken.
Post Reply

Return to “Developers and Code”