Gelbooru

Notice: We are now selling NEW Gelbooru Merch~! Domestic shipping is free on all orders! Do you have an artist tag on Gelbooru? Let us know so we can properly credit you!

Ticket Information - ID: #277


ID:Category:SeverityReproducibilityDate SubmittedUpdated By:
0000277Feature RequestnormalN/A10/19/09 03:27AM
Reporterdemeli
Assigned to:geltas
Resolution:Open
View StatusPublic
Version:0.2.0
Target Version:0.2.1
Summary:Clone Some Danbooru APIs
Description:Sorry I couldn't make you a full spec like I promised I would. University is stealing my time. Enjoy this copy-paste mess from Danbooru, I guess. :-(

They're in order of importance.


LIST NOTES
================================================================================

http://danbooru.donmai.us/note/index.xml?post_id=544436

should accept these GET parameters:

post_id The post id number to retrieve notes for.

No post_id = Last 100 notes

Returns:

<notes type="array">
<note updated_at="Mon Oct 19 08:39:33 -0400 2009" is_active="true" created_at="Mon Oct 19 08:39:33 -0400 2009" version="1" post_id="544436" x="60" body="Uh-huh." id="155398" height="75" creator_id="23205" y="2279" width="34" />
</notes>

updated_at = same date format as in the post API
is_active = whether the note is visible or whether it has been deleted. If gelbooru doesn't keep a history, this is always true
post_id = obvious
x = X offset relative to the post image (probably what you pass to the JS)
y = Y offset relative to th post image
width = width of the note
height = height of the note
id = ID of the note
version = revision of the note (if supported; otherwise, always 1)
creator_id = user ID of the USER who added the note

No notes returns:
<notes type="array"/>

LIST COMMENTS
================================================================================

http://danbooru.donmai.us/comment/index.xml?post_id=519613

should accept these GET parameters:

post_id The post id number to retrieve notes for.

No post_id = Last 100 comments



<comments type="array">
<comment created_at="2009-09-13 03:08" post_id="519613" body="So does Rin get to be Carnage?" creator="ygeo" id="270248" creator_id="80660"/>
</comments>

created_at = Date in post API format
post_id = ID of the post
body = comment's content
creator = username of the creator
id = ID of the comment
creator_id = ID of the USER who added the comments

No comments returns:
<comments type="array"/>


LIST TAGS
================================================================================

Should accept these GET parameters:

limit How many tags to retrieve. Setting this to 0 will return every tag.

THE SUPPORT FOR 0 RETURNING EVERY SINGLE TAG IS CRUCIAL. Use your creativity
to make it not lag the servers (= caching this special case for x minutes).

page The page number.
order Can be date, count, or name.
id The id number of the tag.
after_id Return all tags that have an id number greater than this.

CRUCIAL, for clients that want to see which tags have recently been added.

name The exact name of the tag.
name_pattern Search for any tag that has this parameter in its name.


returns:

<tags type="array">
<tag type="4" count="2" name="asato_ai" ambiguous="false" id="515262"/>
</tags>

type = General: 0, artist: 1, copyright: 3, character: 4.
count = how often this tag is used (if not supported, at least set it to 1 so programs dont filter out the tag)
name = name of the tag
ambiguous = whether the tag is ambiguous
id = the ID of the tag

No tags returns:
<tags type="array"/>
Additional Info: