Read posts from any Tumblr easily thanks to the xml API.
Add this line to your application's Gemfile:
gem 'tumblr_reader'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tumblr_reader
tumblr_reader = TumblrReader::Client.new "http://lesjoiesducode.fr/"
random_article = tumblr_reader.get_random_article
=> Article obj, with the following accessors:
random_article.title # returns "the title of the article"
random_article.body # returns "html body"
random_article.images # returns ["http://image.com/1st.gif", "http://image.com/2nd.jpg"]
random_article.links # returns images + ["http://other_links.com"]
random_article.tags # returns ["1st_tag", "2nd_tag"]
a_specific_article = tumblr_reader.get_article "http://lesjoiesducode.fr/post/:id/slug"
=> Article obj
- Fork it ( https://github.com/otomatik/tumblr_reader/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request