views:

21

answers:

1

What is the best and efficient way to add twitter to a website? There are some scripts in the web with iframes and others don't have a caching/streaming solution (what if twitter is temp. down...). So how should I add tweets to my website the right way? By the way I just need the last x tweets and the "x minutes ago" (I want to make a custom style). Thanks!

A: 

How about the widget that twitter provides for this very purpose? You can customize it right there on their page, then just copy the code, and paste it into your web page. Then you're ready to go.

No PHP required -- this is all javascript/html. You don't need caching -- if twitter is down, the widget will show a message to that effect. It'll be back up at some point, and your tweets will be shown again.


EDIT: The widget twitter provides has a header and footer, and you said you don't want to show those...

I used Safari's "Web Inspector" to look at the markup that is generated by the twitter widget (Firefox's FireBug would have worked just as well for this purpose). It looks like the header area and footer area use the css classes twtr-hd and twtr-ft respectively.

So you could just add a stylesheet rule to your page to hide those areas. Something like this:

.twtr-hd, .twtr-ft { 
    display:none !important; 
}
Lee
I just want the recent tweet + time. I don't know how I can get it (the source code also includes an header/footer)
John Paneth
Have a look at my edit. Please let us know whether that works for you or not.
Lee

related questions