我正在使用 http://tweet.seaofclouds.com/中的脚本在网站上显示最新推文,代码示例 7 显示了如何使用它来显示推文而不显示@replies,我试过这个,但它不起作用。当我这样做时,它只是不显示任何内容。
另外,我如何对其进行重新排序,以便tweet_time在推文之后显示?
谢谢!
工作正常的代码,只显示最新的推文:
<script type='text/javascript'>
jQuery(function($){
$(".tweet").tweet({
username: "fearofmobs",
join_text: "auto",
count: 1,
auto_join_text_default: "",
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..."
});
});
我想使用的代码应该省略@replies,但什么都不显示:
<script type='text/javascript'>
jQuery(function($){
$("#filter").tweet({
count: 1,
fetch: 20,
filter: function(t){ return ! /^@'w+/.test(t.tweet_raw_text); },
username: "fearofmobs"
});
});
这个jsFiddle看起来像你想要的 - 我做对了吗?
jQuery(function($){
$(".tweet").tweet({
username: "fearofmobs",
join_text: "auto",
count: 20,
auto_join_text_default: "",
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...",
fetch: 20,
filter: function(t){ return ! /^@'w+/.test(t.tweet_raw_text); }
});
});