动态Twitter小部件

时间:2012-11-12 15:32:12

标签: javascript jquery twitter

我无法找到我需要的东西......简而言之:

如果我有一个网站,并且用户可以输入他们的推文句柄@user - 我该如何动态撤回他们的推文?

Twitter允许您制作自己的小部件,但不是user作为通话,而是随机数1494028230983

由于

1 个答案:

答案 0 :(得分:1)

如果我理解了您的问题,那么我建议您使用Tweet jQuery插件,该插件将根据给定的用户名从twitter获取推文的数量。它真的很容易使用。

$(".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..."
);

您可以使用class名称通过css应用样式,例如

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}​

有关详细信息,请查看插件网站。

Here is an example