This time I will share jQuery Plugin and tutorial about Simple jQuery Plugin for Displaying Twitter Feed – Tweetie, hope it will help you in programming stack.
Tweetie is a simple and customizable jQuery plugin for fetching, formatting and displaying your twitter‘s feed and using new Twitter 1.1 API.
How to use it:
1. Get a consumer key and secret keys from Twitter developer center
2. Edit api/config.php
file and replace variables with your Consumer and oAuth Keys.
2 |
define('CONSUMER_KEY', 'CONSUMER_KEY_HERE'); |
3 |
define('CONSUMER_SECRET', 'CONSUMER_SECRET_HERE'); |
6 |
define('ACCESS_TOKEN', 'ACCESS_TOKEN_HERE'); |
7 |
define('ACCESS_SECRET', 'ACCESS_SECRET_HERE'); |
3. Include jQuery library and jQuery Tweetie plugin on the web page
2 |
< script type = "text/javascript" src = "twittie.min.js" ></ script > |
4. Create the html for the twitter feed widget
1 |
< div class = "tweet" ></ div > |
5. Call the plugin with options
01 |
< script class = "source" type = "text/javascript" > |
06 |
template: '{{tweet}} < div class = "date" >{{date}}</ div >', // Format how you want to show your tweets. |
07 |
count: 1, // Number of tweets you want to display. |
08 |
hideReplies: true, // Hide replies and only show your own tweets |
09 |
username: null, // Option to load tweets from another account. |
10 |
apiPath : 'api/tweet.php' |
Change logs:
2018-03-28
- fixed the property selection
2016-08-09
2014-11-05
- Disabled cache by default
2014-05-08
- minify tweetie.js with hashtag functionality
2014-05-07
2014-04-02
- Added ability to fetch tweets from a specific list.
2014-02-12
- Fixed the username and hashtags regex
2014-01-30
- Added “retweeted” template tag
- Added username option that allows to pull tweets from any account.
2013-08-01
- Using Twitter’s API to filter replies
This awesome jQuery plugin is developed by sonnyt. For more Advanced Usages, please check the demo page or visit the official website.