Here's an example from Case-Hardened JavaScript, the Twitterati badge.
Just to the right (if you're using an A-grade browser, and if my outside host at r8ar.com stands up under the load) you ought to see a Twitter badge. If you'd like to try it out, feel free ... but please understand that it's running on a host that will undoubtedly crack under any real strain.
user : defaults to my account, kentbrew.height : defaults to 350width : defaults to 250border : defaults to 2px solid bluebackground : defaults to white; if you set evenBackground, oddBackground, and headerBackground, you won't see it at all.userBorder : defaults to 1px dashed grayuserColor : defaults to whatever link color's on your pageheaderBackground : defaults to your main background.headerColor : defaults to black.evenBackground : defaults to your main background.oddBackground : defaults to gray.friends_timeline, and happen to request the same user id you saw here, you might get another copy of your cached call, with my callback twitBack and not the other guy's. [UPDATE: Al3x responded very quickly, and is looking into it.]It's much more interesting with your own Twitter id in the badge, but if you'd like to stalk[H[H[[H[H follow along with ijustine, here's how you'd do it:
<script type="text/javascript" src="http://r8ar.com/twitterati.js">
{
"user" : "ijustine",
"height" : "400",
"width" : "250",
"border" : "1px solid black",
"background" : "pink",
"evenBackground" : "pink"
}
</script>
To try it out, stick this bit into your page, right where you'd like the badge to show up. Whitespace doesn't matter; please feel free to put it all onto a single line if you like.
Most of all, have fun, and please let me know how it goes.
Thanks
http://www.smallhotels.com
Thanks,
Jane
old question? do you know how to use identica-badge on a group instead of an user?
kind regards
jens
This script is really cool! I wanted to know by posting this on my website if I jeopardize the security of any of the people I follow. I hope you can get this script to display the Twitter user name vs the person's name.
As I said below, I will not write a badge that dynamically updates every few seconds. That's too much pressure on the API for a very questionable result; without user intervention, there's no telling if anybody is actually looking or not. (I might consider a "refresh" or "get more" link, but that's for future times.)
follow my timeline so a person can always come back home ....
option for number of entries in windows option
a follow me tag
a tweet this tag....................
At one point there was a Twitter API call that worked for this (statuses/friends_timeline/user.format) but it's been taken down. The best I've been able to do is to grab the user's root object, which shows the latest update from all of his or her friends.
As I said downstream a bit, please use the native Twitter badge if you want just that particular user's updates ... in the meantime, please feel free to set your own header text using "headerText":"your stuff here" in the JavaScript call; this will overwrite "[user] and friends" in the header.
http://tr.im/hgdg
In fact, I used it in a WIP YUI 3 module TwitterFeed (also on github). You should be able to use the function if you wanted the tweets displayed as Twitter does.
...;margin-right:" + $.a.padding + "px;}",
Sorry, but I'm going to politely decline to write such a thing. :)
One thing to remember, though: if you use the copy hosted on r8ar.com and Twitter changes the way their API works, you'll get the fix from me as soon as it goes live. If you host your own copy of the script it will quit working until you update it yourself.
The API call we're using is getting your contacts. You're not listed as one of your contacts, so your latest won't be in there. Twitterati isn't going to show your most recent tweet; that's tops on my list of Things to Fix.
Two factors may be conspiring to keep @thinktrain's posts off your badge:
First, the pipe I'm using only gives back the twenty most current tweets, so if there are twenty more-prolific tweeters in your friends list, they're going to show up. (I need to fix this and offer a parameter that the user can change; the pipe is currently just throwing away those other eighty tweets.)
Second, in looking at your Twitter page I see that you are following more than a hundred people. If my understanding of the Twitter API is correct, the call I'm using only returns 100 people. I'm fuzzy as to WHICH 100 people; it might be the 100 that have updated most recently ... or it might not. If it's not, and he's friend #101 or higher, @thinktrain's posts aren't going to come up.
What happens when you point Twitterati at one of @thinktrain's contacts that doesn't have more than 100 people?
It makes sense to me that this is easier on Twitter's database than a query that dug out all your friends, groveled through every single one of them to find all of their updates updates, sorted the resulting mass, and returned the most recent twenty. The only downside is that you're going to get a maximum of one update per user.
To take it easy on Twitter, I am running the query through Pipes to add an extra layer of caching on top. No matter what happens, Twitterati will never query the same user more than once per thirty seconds, or whatever caching interval Pipes is using.
Also new: quite a few more configuration variables that need to be documented, dates are showing up, CSS is dynamically generated, inline @-urls load properly as users, and hashtags are linked to Summize search results. To go to someone's actual Twitter page, click their name or ID, and then click the header when the link comes up as so-and-so with friends.
I still have work to do on the CSS, which is fighting with my inline stack. Hackety hack....