Fetches your latest tweets
Show your latest tweet or tweets on your website.
Twitter offers two options to show your twitterfetch on your website:
They are fully supported by Twitter and might be the best solution for you.
TwitterFetch uses unsupported Twitter functionality, so there's no guarantee of continuity.
Start by downloading twitterfetch.js to you server and including it in your web page.
In your HTML, make sure you have a place to show the tweets:
Now, use twitterFetch to fetch the tweets and show the first one:
But don't use the widget id 345615146724495360, that belongs to my @edwinmdev Twitter account.
Create a Twitter widget and look at the generated code. You'll find data-widget-id="..." with the number you can use.
The twitterFetch fetch function takes three parameters:
The widget id you get when creating a widget, see above.
An object literal with several options:
images (boolean): when false, prevents loading images that are not needed (default: false).
plaintext (boolean): when false, encodes some entities to make the text safe for HTML (default: false).
hyperlinks (boolean): when true, turns urls and Twitter @usernames into hyperlinks (default: true).
images: falseplaintext: true
The function that is called back with one argument containing an array with tweets.
TwitterFetch is copyright 2016 Edwin Martin and MIT licensed.