Search code examples
javascriptapiembedfeedtumblr

Getting post date from tumblr feed


I want to embed a tumblr feed on my page and tumblr offers a pretty easy was for doing this. You just have to include

<script type="text/javascript" src="http://yoururl.tumblr.com/js"></script>

in your site (replacing "yoururl" with the actual url) and the feed is there and can be customized by CSS. There is of course also the option to use the "API read" but then it is getting by far more complex as I would have to code some crazy JS which I'm not capable to do at the moment.

The problem with the "easy way" is that it doesn't include the posts date in the output. It returns the posts in an ordered list ("ol" and "li" tags).

Does anybody know a way to get the date for the posts for this method? The documentation isn't very detailed and maybe there is some sort of parameter that can be added (or maybe the documentation isn't detailed because there isn't anything more to explain so "no parameter available" and I have to deal with that).


Solution

  • You can access the rss feed (http://blogname.tumblr.com/rss) to get this info. Easier to parse too. You'll want the pubDate. eg:

    <pubDate>Mon, 16 Apr 2012 12:49:24 -0700</pubDate>