February 26, 2009

My interest is piqued at this notion of a web application whose back-end deals in JSON exclusively when communicating to the front-end. JSON served by the server, processed and rendered on the client. Generated client events, from classic form submissions to exotic componentized elements, transmitting interaction and event data as JSON objects.

I haven’t yet had time enough to steep in this, but it is a very interesting and unique approach.  Read the original posts here.

9:21am  |   permalink
February 21, 2009

Embedding Tumblr via JS (and Filtering by Post Type)

I have a blog on blogger, though now that tumblr has captured my attention (at least for the moment), that may not be the case in the future. I’ve kept that blog for a while to document life, experiences, and travels, and there are a handful of people that actually read it (ie friends and family).

When I started using twitter, I wanted to hook up my updates to a widget on blogger. I wanted this because the posts I was making on blogger required much more commitment, and sometimes one’s just not in the proper frame of mind. Luckily, twitter provides a simple javascript-based method of inclusion.

Now that I’m using tumblr, I wanted to do the same thing. This of course is easy - looking in the “Goodies” section shows a plethora of ways to integrate with tumblr, and a simple JS include is available. All you do is provide the URL of your tumblelog with the path “/js” appended to it as the argument to the script tag’s src attribute. For my tumblelog, the full tag would be:

<script type=”text/javascript” src=”http://iamchrislewis.tumblr.com/js”></script>

The tumblelog I’m actually connecting to my blogger account is slightly less nerdy, so my real tag would be:

<script type=”text/javascript” src=”http://theproving.tumblr.com/js”></script>

Nice and simple, with one problem. I want the tumblr items to show up in a widget on my sidebar, so pretty much anything other than text is off limits. I took a stab at specifying a type, and lo and behold, it works. First off, peek at the normal embed source::

http://theproving.tumblr.com/js

and then:

http://theproving.tumblr.com/js?type=text

I made the guess that tumblr would actually look for a “type” parameter, and that its values would be the known post types (text, photo, et al). Lucky for me and my blogger blog, I was right. I don’t think this behavior is documented anywhere, but it is present.

Note: I just checked for this on the “/rss” responder, but it doesn’t seem to pay attention.

11:00am  |   permalink
  
FILED UNDER: javascript tumblr programming