1.0.1 • Published 7 years ago

tumblr-feed v1.0.1

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
7 years ago

<tumblr-feed>

Web Component for easily getting a Tumblr blog JSON feed.

Install

$ yarn add tumblr-feed

then inside your JS files you can include it

import 'tumblr-feed';

or if you want to use the pre built version

<script src="./node_modules/tumblr-feed/tumblr-feed.js"></script>

How to use

The bare minimum to have it working is to write the tag with the "blog" attribute set:

<tumblr-feed blog="staff"></tumblr-feed>

and then in your Javascript file

function tumblr(data){
  console.log(data) // the data returned from the specified blog
}

Options

PropertyTypeDefaultRequiredDescription
blogString"staff"truethe name of the blog you want to load data from (example: staff.tumblr.com)
callbackString"tumblr"falsethe name of the callback function that will be executed on loading the feed
postsNumber10falsethe number of posts to get, maximum 50

Polyfill

This component is built on top of Web Components v1 specification, if you need to have it run on modern browsers (modern means excluding IE11...) you can include the official polyfill, available on both the NPM and Bower registries.

#usetheplatform

Limitations / project purpose

This Feed APIs are really bad designed by Tumblr, so all limitations like max number of posts and the callback function exposed as a global one cannot be overridden.

The purpose of this web component is to quickly retrieve one or more Tumblr blogs feed (in JSON format) for simple projects.

If you need deeper integration with Tumblr inside an application you should definetely look for the official APIs.

License

Distributed under the Apache 2.0 license.

1.0.1

7 years ago

1.0.0

7 years ago

0.6.0

7 years ago