Josh
Josh

Reputation: 615

Dynamic Twitter Widgets

I am having trouble finding what I need.. in short:

If I have a site, and the users are able to enter their twitter handle @user - how can I dynamically pull back their tweets?

Twitter allows you to make your own widget, but instead of user being the call, it is a random number 1494028230983

Thanks

Upvotes: 1

Views: 331

Answers (1)

The Alpha
The Alpha

Reputation: 146191

If I understood your question then I would recommend you to use Tweet jQuery plugin which will fetch the number of tweets from the twitter according to the given username. It's really very easy to use.

$(".tweet").tweet({
    username: username,
    join_text: "auto",
    avatar_size: 32,
    count: 5,
    auto_join_text_default: "we said,", 
    auto_join_text_ed: "we",
    auto_join_text_ing: "we were",
    auto_join_text_reply: "we replied to",
    auto_join_text_url: "we were checking out",
    loading_text: "loading tweets..."
);

You can apply style by css using the class names, like

li{margin:5px 0;border:solid gray 1px;border-radius:2px;}
li.tweet_odd{ background:#eee;}
li.tweet_even{ background:#f0fff0;}
li a.tweet_avatar{float:left;margin-right:5px;}
li span.tweet_time a{text-decoration:none;color:green}
li span.tweet_text a{text-decoration:none;color:green}
li span.tweet_text{color:#333}​

For more information check the plugin site.

Here is an example.

Upvotes: 1

Related Questions