From 170ef96000ff87bff8dcc8d83eab7f758ced74ba Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Sat, 15 Feb 2014 20:42:44 -0200 Subject: [PATCH] experimental top trending hashtags (requires twister-core 0.9.14) --- home.html | 8 ++++++++ interface_home.js | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/home.html b/home.html index f5593bb..c75da00 100644 --- a/home.html +++ b/home.html @@ -136,6 +136,14 @@ + +
+

Top Trends

+
    + +
+
+ diff --git a/interface_home.js b/interface_home.js index 8019840..41c1f5b 100644 --- a/interface_home.js +++ b/interface_home.js @@ -59,6 +59,24 @@ var InterfaceFunctions = function() setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000); setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000); setTimeout("getRandomFollowSuggestion(processSuggestion)", 1000); + + twisterRpc("gettrendinghashtags", [10], + function(args, ret) { + for( var i = 0; i < ret.length; i++ ) { + + var $li = $("
  • "); + var hashtagLinkTemplate = $("#hashtag-link-template").clone(true); + hashtagLinkTemplate.removeAttr("id"); + hashtagLinkTemplate.attr("href",$.MAL.hashtagUrl(ret[i])); + hashtagLinkTemplate.text("#"+ret[i]); + $li.append(hashtagLinkTemplate); + $(".toptrends-list").append($li); + } + }, {}, + function(args, ret) { + console.log("Error with gettrendinghashtags. Older twister daemon?"); + }, {}); + if( args.cbFunc ) args.cbFunc(args.cbArg); }, {cbFunc:cbFunc, cbArg:cbArg});