re_tumblr
A javscript-badge that handles these post types (all available as of 2008/11/20): audio, conversation, link, photo, quote, regular, video
Requirements: Prototype.
It produces basically the same html structure as the standard tumblr javascript produces but adds additional date and the tag divs. It also links photos to the post itself. Click-through links aren't supported by the API (yet?).
The used css classes are (for your reference):
tumblr_posts, tumblr_post, tumblr_[type]_post,
tumblr_date*, tumblr_tags*,
tumblr_title,
tumblr_photo, tumblr_photo_link*,
tumblr_link, tumblr_video, tumblr_audio,
tumblr_caption, tumblr_body, tumblr_label,
tumblr_open_quote, tumblr_close_quote, tumblr_quote, tumblr_source,
*(new classes)
to use it, you just call the javascript like that:
tumblrPosts({})
or with some options:
tumblrPosts( {"username" : "restorm-news", "num" : 1} )
At the moment, there are just 3 functions:
- tumblrPosts() to add a whole feed
- tumblrLastPostDate() to output the date of the latest post
- tumblrPostsAppend() only used internally for a budget pagination: it only adds posts to the bottom
All three have their callback counterparts, which actually insert the content after the data is loaded:
- tumblrInsertPosts()
- tumblrInsertLastPostDate()
- tumblrInsertPostsAppend()
The actual content is inserted into divs with css-classes and ids deriving from the callback:
- class = "tumblrInsertLastPostDate_container" p.e. for all tumblrLastPostDate inserts and
- id = sanitized tumblr username + classname
You can style the containers to prevent shifts in the layout while the tumblr content loads.