Dokuga Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Dokuga Web API
(1 viewing) 1 Guest
Go to bottom
TOPIC: Dokuga Web API
#86060
Mitharus
Admin
Posts: 318
graphgraph
User Offline Click here to see the profile of this user
Dokuga Web API 11 Years, 10 Months ago Karma: 53
Hey all,

So... from a few requests I'm finally getting around to coming up with some Web API that can be used to pull information from the database. The below example page is in flux.. so it could change, and not everything I've mentioned is implemented.

Example page for Sugar0o (Since there's multiple stories there too!). Sorry the CDATA sections are a pain, and I probably don't need to encode the HTML entities there... :/

Edit:
And here's a link for the output for stories....
Stories example

Edit 2:
Updated so the users one outputs pure XML by default. If you want the text output add the param: ?output=text to the URL.
Example text output for Sugar0o

The basic usage is planned to be something like:

host.here/api/users/Sugar0o -- Pull everything attached to the username (ID works too)
host.here/api/users/Sugar0o/stories -- Pull only stories
host.here/api/users/Sugar0o/forum -- Forum info
host.here/api/stories/1234 -- Pull the *summary* info for the story with ID 1234
host.here/api/stories/1234/34 -- Pull chapter 34 of story
host.here/api/stories/1234/full -- Pull the Full story (maybe? Could probably destroy the DB access times if there were lots of pulls :/ )

The output is going to be basic XML (what's shown at the end of the example). Right now I only have the users partially written, but I have some questions.

1) For you users: What data do you want made available? I need to use the 'username' field, and not the name field, as the username needs to be unique but the name doesn't. For your e-mails, I'm NOT going to make that available unless for some reason the majority wants that. If that's the case, then I'll probably find some way to make an option to allow the API access to show the e-mail that can be set in your profile.

2) For any doing developing: What data do you want access to? (Besides the standard: "Everything you have." reply). What would you need to make whatever it is your doing work?

2a) I *will* be doing some API Key type thing and restricting access. So the real requests would look something like:

host.here/api/users/Sugar0o?apikey=[whatever]

And then that key would need to be valid, before it'd even try pulling anything. Probably will allow for both GET/POST requests, even though nothing will be allowed to be changed through the API; Only pulling data.

Err... yeah. So... Let me know!

-J
 
Logged Logged
 
Last Edit: 2013/01/11 17:12 By mitharus.
  The administrator has disabled public write access.
#86183
Mitharus
Admin
Posts: 318
graphgraph
User Offline Click here to see the profile of this user
Re:Dokuga Web API 11 Years, 10 Months ago Karma: 53
I've created a really generic XSLT style sheet for the users xml output...

Basic XSLT Style sheet

Doesn't have everything I'm pulling currently, but it's an example anyway...

http://dkga.csit.parkland.edu/api/users/mitharus?style=1

Use the 'style=1' http param to have it add in the style sheet, otherwise it'll skip adding that header in the XML output, and just spit out the plain XML.

Will probably not work in every browser that looks at it ... but hey, it's an _example_.

-J
 
Logged Logged
  The administrator has disabled public write access.
#86243
Mitharus
Admin
Posts: 318
graphgraph
User Offline Click here to see the profile of this user
Re:Dokuga Web API 11 Years, 10 Months ago Karma: 53
And another update...

JavaScript hook (really not complete... but a start anyway) for the API.

http://dkga.csit.parkland.edu/api/Dokuga.js

Simple HTML Test with JavaScript (View page source)

Not wonderful by any means... So umm... Yay?

-J
 
Logged Logged
  The administrator has disabled public write access.
Go to top

INUYASHA © Rumiko Takahashi/Shogakukan • Yomiuri TV • Sunrise 2000
No money is being made from the creation or viewing of content on this site, which is strictly for personal, non-commercial use, in accordance with the copyright.