= Inkbunny API Documentation =

Hello fellow API Users!

In this documentation i give you a brief explanation about the JQuery Inkbunny API Plugin.

There is a fully functional index.html that comes along with it.
Just put into an empty folder on your webpage to see how it works.

If you know JS, HTML and CSS you can skip until the advanced section of this docu.

== First Steps ==
Make sure to implement the following lines in your <head> area on the page you want to use it:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript">
</script>
<script src="js/jquery.ib_latest_images.js" type="text/javascript">
</script>
<link type="text/css" rel="stylesheet" charset="UTF-8" href="css/inkbunny.css" />

And make sure js and css are accessable from that page.

If you have done that, open the jquery.ib_latest_images.js in your js folder with any desired editor (For example notepad).
Replace tha value 'Kogentasama' of $.inkbunny.search_username with your username.

Add the following code to any place in your site you want the plugin to show your last 10 most viewed submissions.

<div class="ib_api">
	<p class="ib_head">My Top10 viewed submissions</p>
	<div id="ib_latest_images">
		#IMAGES#
	</div>
</div>

== Finished ==

Now save everything, load it onto your webserver and open your Page.

Tadaa! Now your most viewed 10 submissions are being shown.

There is a CSS file in the css folder which handles the layout.

If you want to change it from 10 to 5 just look for "senddata.submissions_per_page" and change it's value to 5.

Read the documentation about the search api to see what else you can search and show.

== Advanced ==
Okay fellow web-coders, something you need to know:
Install firebug to see some magic in your console.

We use JSONP to get the appropriate data from the API, the first connect call should be made by any chance.
This is going to get us a valid SID we can work with.
The SID is being saved to $.inkbunny.session.

ANY call that comes after it has to be registered in the queue.
JSONP is only async so we have to queue it! Otherwise things get out of sync ;)

But as you can see it is pretty simple.
add_func('fetch_last_five($.inkbunny.search_username);');

Just fool around with it a bit and see how it works.

I hope you enjoy our little example!

Comments and sugegstions as support ticket. Please Include "Inkbunny Jquery API" into the Title. Many thanks!