Browse Source

update Tranding Hashtags every 20 minutes

master
Denis Ryabov 11 years ago
parent
commit
90a23523aa
  1. 16
      js/interface_home.js

16
js/interface_home.js

@ -70,10 +70,19 @@ var InterfaceFunctions = function()
setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000); setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000);
setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000); setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000);
updateTrendingHashtags();
if( args.cbFunc )
args.cbFunc(args.cbArg);
}, {cbFunc:cbFunc, cbArg:cbArg});
}
function updateTrendingHashtags()
{
$(".toptrends-list").empty();
twisterRpc("gettrendinghashtags", [10], twisterRpc("gettrendinghashtags", [10],
function(args, ret) { function(args, ret) {
for( var i = 0; i < ret.length; i++ ) { for( var i = 0; i < ret.length; i++ ) {
var $li = $("<li>"); var $li = $("<li>");
var hashtagLinkTemplate = $("#hashtag-link-template").clone(true); var hashtagLinkTemplate = $("#hashtag-link-template").clone(true);
hashtagLinkTemplate.removeAttr("id"); hashtagLinkTemplate.removeAttr("id");
@ -86,10 +95,7 @@ var InterfaceFunctions = function()
function(args, ret) { function(args, ret) {
console.log("Error with gettrendinghashtags. Older twister daemon?"); console.log("Error with gettrendinghashtags. Older twister daemon?");
}, {}); }, {});
setTimeout(updateTrendingHashtags, 20*60*1000);
if( args.cbFunc )
args.cbFunc(args.cbArg);
}, {cbFunc:cbFunc, cbArg:cbArg});
} }
} }

Loading…
Cancel
Save