There is a Facebook fans widget, Google friends widget, what about a Twitter friends widget?!
Here is a jQuery plugin that you can embed anywhere to display pictures of your Twitter followers or friends (whom you follow) and their latest tweets if you like.
By featuring your Twitter friends or followers on your blog, you will encourage others to become friends too..
Update Feb 20, 2012
A new version of this plugin is released! New version aims to be better looking and easier to setup.
A new version of this plugin is released! New version aims to be better looking and easier to setup.
View these Demos..
Each demo page contains HTML & CSS & JS you need to use... CSS code is essential for this widget looking, but will not focus on it here.
Demo 1: Simple Followers List ►
By Default widget will fetch your latest 100 followers and append each picture of the 1st 20 of them with a fade transition, then the 2nd 20 pictures, then 3rd 20 and so on..
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://twitter-friends-widget.googlecode.com/files/jquery.twitter-friends-1.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#friends').twitterFriends({
debug:1
,username:'Mike_More'
});
});
</script>
<div id="friends"></div>
Demo 2: Your Profile & Followers List ►
Now, to show your Twitter profile information -your picture, profile link, followers count- we will use the (header) option. which may contain any HTML code with these optional variables:
_tp_ : Twitter profile Link.
_ti_ : Twitter picture.
_fo_ : followers count.
_fr_ : friends count.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script
type="text/javascript" src="http://twitter-friends-widget.googlecode.com/files/jquery.twitter-friends-1.0.min.js"></script>
<div class="twitter-friends" options="{
username:'Mike_More'
,header:'<a href=\'_tp_\'><img src=\'_ti_\'/></a><h2>_fo_ Awesome Follwers!</h2>'
,user_animate:'width'
,users:50
,user_image:32
}"></div>
To install this widget:
1. Embed CSS code from demo page then include jQuery JS file and widget JS file.
2. Add a div with a "twitter-friends" class.
3. Don't forget to set (username) option with your Twitter username, which is the only essential option!
Also Note that:
- Unlike typcial JS call in demo 1, any Div's with a "twitter-friends" class will be automatically widgetized!
- any single quote (') inside the header value must be escaped with (\')
- Used the 'width' for picture animation instead of default fade animation.
- Changed the default visible users count to 50, Scaled down each pictures to 32x32, and the width of container so the 50 pictures would be divided into 4 rows equally.
Demo 3: Simple Friends List ►
As in demo 1 except (friends) option was set 1 to switch to friends mode.
You can see that widget is very flexible and can fit in different layouts.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script
type="text/javascript" src="http://twitter-friends-widget.googlecode.com/files/jquery.twitter-friends-1.0.min.js"></script>
<div class="twitter-friends" options="{
friends:1
,username:'Mike_More'
}"></div>
Demo 4: Your Profile & Friends & Friends Tweets ►
Another optional part in this widget is Friends tweets. after friends pictures were added, their latest tweets will start animate one after another. when you enable tweets by setting (tweet) option to 1 each friend icon will also show his/her tweet as a tooltip.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script
type="text/javascript" src="http://twitter-friends-widget.googlecode.com/files/jquery.twitter-friends-1.0.min.js"></script>
<div class="twitter-friends" options="{
username:'Mike_More'
,friends:1
,tweet:1
,header:'<a href=\'_tp_\' title=\'follow me\'><img src=\'_ti_\'/></a><h2>_fr_ Friends / _fo_ Followers</h2>'
,loop:1
,users:50
,user_animate:'height'
}"></div>
you can also see that we used the (header) option to show number of Friends & Followers.
and (loop) option was set to 1 to loop users pictures animation.
Widget Highlights:
- Show your latest Twitter Friends and Followers with custom animation.
- With your own words; Display your profile and total count of your friends and followers.
- Display your friends or followers latest tweets.
- Instead of linking a picture to friend's twitter page; You can link it to his/her home page. So, They would know that your are linking to them (by referrals).
- Don't worry about your SEO with the quality of all these outbound links as they are loaded by Javascript and wouldn't be visible to a search engine crawler.
- Widget is very flexible and can easily fit in different layouts by adjusting the number of visible pictures and its dimension.
- Many pictures & tweets transition options like opacity, width, height.
- Each part of the tweet like Avatar, links, Hashtags.. has its own CSS class so it can be styled easily.
- Show or hide some parts of the tweet like avatar, author name, date, etc...
- Use a typical JS call or auto-load div elements that have "twitter-friends" class.
- Widget adds a small "i" letter that links to the widget page. You can remove it by setting (info) option to empty string (''), but I'll appreciate it if you attribute/link-back to me elsewhere on your website.
This looks just like TweetPeep that came out a couple of months back.
http://www.hpoom.co.uk/projects/tweetpeep/
@Simon,
Sorry, I don't see how..
I didn't see that Tweetpeep plugin before, It looks very interesting. It is defined as:
"TweetPeep is a jQuery plugin to allow people to have an area in their page wallpapered with twitter profile images of people who are talking about a common subject or word".
But this plugin is a Twitter friends widget!
Hey, nice to see my picture in your top image ;) Expect a tech tweet soon ;)
@Elijah,
Thanks for the comment and tweet.. Your picture had to be there :)
Mike & Simon, thanks for educating to the existence of both of these plugins. I'm primarily an ASP.NET guy doing a mix of biz-apps and social network biz-aaps, who started drinking the jQuery juice over the summer, and loving it. I can definitely see uses for both plugins, thanks again.
@Andrew,
you welcome :)
does this work in a hosted wordpress blog? I've tried it (with a thesis theme), but just does 50 twitter icons down and 1 wide? Any ideas why?
Thanks.
@Anonymous,
It should work anywhere.. but what do you mean by "just does 50 twitter icons down and 1 wide"?
It would be better if you can email me with more details and your blog link.
@Anonymous,
That happens when you forget to copy the CSS over. View the document source of the example and you'll see the other necessary code.
Thanks for the plugin. Worked perfectly right off the bat. :)
@Anonymous,
great.. thanks for your feedback!
This plugin is attracting many people that are called 'Anonymous' :)
Hello Mike, this is by far the best twitter widget developed so far - simply Fantabulous ! :)
Wishing you much continued future success within your career & life endeavors .
M.
@Mia,
Thanks for the kind words and the RT :)
Wish you too a successful life and blogging.
nice post about twitter widget, im just a newbie, and i just little know about twitter and facebook, thanx :D
Thanks for the jQuery plugin. Its a good app to be used both on facebook and twitter. Thanks the great post on the topic.
Looks great in Chrome, but it won't work for me in latest FF.
@Anonymous,
I don't see any problems in the demos, can you give me more details:
What FF version exactly?
Which Demo?
Do you see errors on FF error console?
Is Twitter.com itself is down?
Should you email me for better help?
Brilliant absolutely brilliant!!!
Hy ! i've written an extension for the CMS Spip based on your plugin. it works good ans the simplicity of use of your plugin allows a fast integration in this CMS. You can see the result here (http://www.spip-contrib.net/Plugin-Mytwitter).
Thanks a lot for your great job ! (and sorry for my english)
@yves,
No, Thank you for the attribution. I really appreciate it :)
I didn't hear about SPIP but now I gonna take a deeper look..
Your English is "très bien".
Hi Mike. I am new to Twitter and Blogging and trying to setup the official Twitter widget, just like the one on this site. I embedded it fine and it's working properly, I think... but one problem: it doesn't display my followers tweets inside the box so it looks like I'm just talking to myself. Anyway I can fix this or any suggestion for a different widget? Just to be clear, I don't care about showing off my Followers avatars, I just want to have a comment box that displays both my tweets and my followers. Thanks a lot!
@LunaLuna,
I think this is what you need: http://kentbrewster.com/twitterati/
thats a nice post,thank you
Awesome plugin !!! Love it !!!
Now, I want a "target blank" link in pictures :P
How do it ??
Cheers,
Gabriel
Im trying to get it to display all my followers... it seems to reach 97 then stop... any ideas?
im so sorry, but ive been reading this page for about 3 hours now,over and over again, but i still cant put the widget on my blog,
for the DEMO 1, when i paste the code, everything works fine, but when i tried the other , it wont work,
i really like to put the DEMO 2 and DEMO 4, please help me with this problem..
@shakime,
Email me your URL to better help you.
@Kevin,
I see.. this is weird!
Really helpful post, the best way to show your twitter friends on your website.
I have the same problem of shakime, the script shows 20 followers at a time for 5 times (in total 100 followers), then start again without showing the remaining followers.
I hope you can find a solution, in the meanwhile, thank you great work!
michael
Sorry, I was referring to the issue of Kevin not shakime.
However I noticed in your Demo 1 that the number of followers will stop at 100, so I would say that there is definitely a problem with the maximum number of followers.
Would be nice if you could fix this problem :)
michael
Hi mike,
is it possible to get the user names instead the images?
is this widget compatible for blogspot user? will you show me how to use for my blog
@thinchhia,
Yes, it is pure JavaScript. go to Blogger > design > Page elements > add HTML/javascript widget somewhere and set its content with code as in demo 1...
thanks i did it!! thank you
Hi Mike, no answer to my questions ?
There is a way to display all the followers and not only the last 100 ?
Thank you
@Kevin,
Te result set isn't guaranteed to be 100 every time as suspended users will be filtered out.
@michael,
It is not a problem, the plugin was designed to get your latest 100 friends only.. I'll try changing that in next version.
Thanks for your answer!
I will wait the next version.
Thank you for this amazing widget!
Any chance we could get a randomized output of followers? Also, wondering if we could return live search query results instead of just things your followers have said.. Lastly, while it's displaying each batch of followers could there be a way to not have it clear the row but simply have like an update "overlap" the previous?
This is another request for the widget to display more than the last 100 followers. Would like an option to display all followers.
Thanks, we really enjoy this plugin!
I have added this to my site but it asks new users to login to the twitter API. I assume I need to authorise the application somehow with twitter. Does anyone know how to do this ?
@glenda,
Can you post/email me a demo link?
Your Twitter account is private?
Hi there -- I added your widget to our page, but it list all followers in a single line instead of box format - am I doing something wrong? page is at www.houstontlt.com Thanks! Kimmy
@Kimmy,
You welcome..
You need to add CSS code from demo page that is marked as "<!-- Required CSS -->"
@Mike - I've added the code at the top of the sidebar page, before the widget, everywhere! Still can't get it to work :(
@Kimmy,
You've removed the widget from you site?
Plz, email me for further assistance.
Thanks. Love it. Just what I wanted!
Brian Quilty
President
Landbidz.com
Great widget!
Fantastic options and easy to style/customize.
If add this to my website that gets a fair amount of traffic, will there be any problems with too many hits to the Twitter API, or anything like that? Does the script cache data, or get new data on each call?
Thanks :-)
Hi WayneM,
Thanks for your feedback :)
Twitter uses IP-based rate limiting. So, too many hits blocks the user not your site..
No caching is used.
Thanks for your last reply - that's good to know. I think I hit the limit last night while testing various styling :-)
Another question:
Maybe I misunderstand the "user_append" option. I set it up with the default "1", and that works. Changing it to "0" does not seem to have any effect. I was hoping to have the followers display in reverse order - so the newest follower shows first. I only display a limited number of followers (6, for now) - no looping, no animation. So, it's just showing the same followers in the same order. Is there a way to have it display the newest follower first?
@WayneM,
Setting 'user_append' = 0 to insert user pictures at the beginning of pictures list.
There is no way to display newest first, will change that in newer version!
Awesome plugin! I am using it on a site for the "follower's tweets" feature and its great, but for some reason the same few tweets from the same few people keep looping, even tho there are newer tweets out there from different people. Is there any way to force the plugin into refreshing every few seconds?
Thanks in advance for the code =D
Thanks @Nelson,
Twitter returns friends list plus the last tweet for each one.. and that's ok cause friends list is the main concern here..
May be in future version will query the timeline of each friend.
Here is a question for you... I am using a microblogging system simpliar to twitter which uses the OAUTH as twitter, would I be able to use this script for my mircoblogging software with some minor changes?
@Kennedy,
it depends on the API of that Micro-blogging software, I need more details..
hanks for sharing! very much it was useful
Great plugin and instructions. Thanks so much :)
Hi again - on the top right corner of demo 2, there is a grey ".i" showing up in your sample and on my page where I posted your code.
What is this and how do I get rid of it?
@Heather: Add the following...
,info:''
just after where you entered the username that will get rid of the i
Hi there - I have copied your code exactly from Demo 1, but it's not working - even though I haven't changed anything. Please could you point me in the right direction? My link is here: http://www.wheretohunt.net/test.html
Hi @Berecca,
The link looks fine to me, if you need further assistance email me..
Thankyou very much for this excellent tool!
Congrats, you also made it onto SnackMoney.com !
@Snack Money,
Thanks for featuring my plugin on your website, much appreciated :)
Hi Mike,
The plugin has suddenly stopped working across all my browsers. Shows number of followers but not their faces. Has something changed at Twitter or is it a temporary glitch? The demos on here have also stopped working for me. Anyone else having the same problem?
@Skip,
thanks for the heads up.. I fixed that error caused by changes in Twitter API..
Please note that this fix might take few minutes because of the caching by Google code hosting.
If you use a copy of the plugin file then please use the updated version [jquery.twitter-friends-1.0.min.js].
hi Mike, your work is awesome! but unfortunately after waiting quite some time, neither fetching the js from google or linking directly to the file works, just happened last night and have been keeping an eye on the blog to make sure I update the widget correctly. thanks!
@Anonymous,
If you still have the old plugin file loaded, try this trick to force Google code to return the fresh copy. append any random query parameter to the plugin url like this
<script type="text/javascript" src="http://twitter-friends-widget.googlecode.com/files/jquery.twitter-friends-1.0.min.js?any=1"></script>
mike I have no idea where I am botching it, the code is exactly the same as before, friends div, css, etc. I tried get google to reload, I linked to it locally, the only thing I can think of is the jquery I am pulling from google is 1.4.4 not the version you have in your demos. Does so many sites testing out ipv6 have anything to do with it, cause I just can't see anything from the country where I live.
Whether or not I can get this going again, just want you to know how important people like you are to many of us who can't seem to get past html and css, we can play around with basic php and JS, but it's you guys who make life so much better!!
@Anonymous,
plz, check the trick I mentioned in my last comment about adding a random query parameter to the plugin URL..
mike, it worked!! the random query is similar to getting a css file to reload, I don't know where I messed things up, but spent my time today, reviewed the source of your demos, cleared cache on my cms, opened a new browser, cleared it's cache and all nice a pretty!! you are super duper cool!!!
Hello Mike, many thanks for your great script. I got the Demo 3 working at http://lastingrose.blogspot.com/ but can't somehow get DEMO 4 to work. Strangely, the Blogger widget refuses the code you have given. In my case, I have stored both scripts in the Blogspot HTML,only the calling code is in the widget, which seems OK for Demo 3.
Could you please let me know how to solve this ?
Many thanks for the great tool again.
@Lasting Rose,
mostly because of option "header" that contains html code as a value. so, try to escape html or avoid using html at all in that option..
for more assistance you can email me.
Mike, Even my Demo3 on the widget stopped working and I can't get it to work even when I load the css, the scripts and the call all in the main HTML of blogger. I have even escaped the call like this.
(div)
<div class="twitter-friends" options="{debug:1,friends:1,username:'lastingrose'}"></div>
(/div)
Can't get a clue as to why nothing is loading.
@Lasting Rose,
I tried to reply to your email but I got a delivery-failure message. anyway, here is the sample code I wanted to send you
http://jsfiddle.net/VCr7M/3/
Hi Mike,
As per your link, http://jsfiddle.net/VCr7M/3/ why the twitter thumbnails are limited to 100?
@RAGHAVENDRA,
Because, Twitter API returns latest 100 Followers/Friends or less per 1 request..
Sorry for my English, is translated with software
Congratulations
is a wonderful utility
I am installing in joomla, but I have two problems.
1 - there is much separation between the top and my title??
2 - how I can reduce the width
thanks a million
Best Regards
@Anonymous,
please send me a sample url to my email mike @ moretechtips.net
@khawer,
You can remove it by setting (info) option to empty string ('')
Hello Mike, my name is Betsa, I'm working in a web project and I used your usefull jQuery widget, but already have a problem:
My boss is (bother me) needing that the result of our followers be saved in a table of our data base. Can you please give me an idea about how can I do it?
Sorry by my poor english u.u and Im waiting your answer!
@Anony,
If you are trying to build it from scratch you can go though the Twitter API.
If you still need help, please email me..
I have tried this on my website but unfortunately images appear one by one.
eg:
1
1
1
1
and not
11111
11111
the same issue someone has mentioned above but he couldn't convey it better so i think this may make you clear
@Arun,
I guess you forgot to copy CSS from demo page. if you need further assistance email me a sample url.
Hello!
Your script conflicts with Mootools, how to resolve conflict?
Sorry for my english, I'm from Belarus...
@Stanislau,
My plugin is not the problem for sure :)
There are many solutions for that, try this
1) jquery include
2) jQuery plugins include and code
3) jQuery.noConflict();
4) mootools include
5) mootools plugins
You could also avoid using "$" as shortcut for jQuery object, and use "jQuery" instead. After calling "jQuery.noConflict()" which disables the shortuct "$" at all.
Finally, you can avoid having both libraries on one page..
if you need further assistance, email me your url.
Mike - is it possible not to animate photos of followers, showing e.g. one row of different photos each time the site is loaded?
@Piotr,
If you set 'users_max' the same as 'users' then no swapping happens.
Also set transition time 'user_change' to 0.
Showing different photos each time is loaded, can be added in future versions..