1 2 3 4 5 6 | <!-- DC Twitter CSS --> < link href = "dcodes/twitter_tweet/jquery.tweet.css" rel = "stylesheet" > <!-- jQuery Library (skip this step if already called on page ) --> < script type = "text/javascript" src = "dcodes/jquery.min.js" ></ script > <!-- (do not call twice) --> <!-- DC Twitter JS --> < script src = "dcodes/twitter_tweet/jquery.tweet.js" charset = "utf-8" ></ script > |
1 2 3 4 5 6 | <!-- DC Twitter CSS --> <!-- jQuery Library (skip this step if already called on page ) --> < script type = "text/javascript" src = "http://cdn.dcodes.net/2/jquery.min.js" ></ script > <!-- (do not call twice) --> <!-- DC Twitter JS --> |
Display one tweet at a time like a news ticker from twitter user "twitter"
loading ...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | <!-- DC Twitter Settings --> < script type = "text/javascript" > jQuery(function ($) { $("#ticker").tweet({ username: "twitter", // define your twitter username page: 1, avatar_size: 32, // avatar size in px count: 20, // how many tweets to show loading_text: "loading ..." }).bind("loaded", function () { var ul = $(this).find(".tweet_list"); var ticker = function () { setTimeout(function () { ul.find('li:first').animate({ marginTop: '-4em' }, 500, function () { $(this).detach().appendTo(ul).removeAttr('style'); }); ticker(); }, 4000); // duration before next tick (4000 = 4 secs) }; ticker(); }); }); </ script > < style type = "text/css" > #ticker ul.tweet_list { height:4em; overflow-y:hidden; } #ticker .tweet_list li { height: 4em; } </ style > <!-- DC Twitter Start --> < div id = "ticker" class = "query" style = "width:80%;" ></ div > <!-- DC Twitter End --> |
Display three latest tweets from twitter user "twitter"
loading tweets...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <!-- DC Twitter Settings --> < script type = "text/javascript" > jQuery(function ($) { $(".tweet").tweet({ username: "twitter", // define your twitter username avatar_size: 16, // avatar size in px count: 3, // how many tweets to show loading_text: "loading tweets..." }); }); </ script > <!-- DC Twitter Start --> < div class = "tweet query" style = "width:80%;" ></ div > <!-- DC Twitter End --> |
Display five newest tweets based on query: "#Microsoft". Refresh feed every 60 seconds in real-time.
Query by text or #hash tag acceptable.
searching twitter...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <!-- DC Twitter Settings --> < script type = "text/javascript" > jQuery(function ($) { $("#query").tweet({ avatar_size: 16, // avatar size in px count: 5, // how many tweets to show query: "#microsoft", // search query loading_text: "searching twitter...", refresh_interval: 60 // seconds before next refresh }); }); </ script > <!-- DC Twitter Start --> < div id = "query" class = "query" style = "width:80%;" ></ div > <!-- DC Twitter End --> |
Display ten newest tweets from two twitter users "microsoft" and "google"
searching twitter...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <!-- DC Twitter Settings --> < script type = "text/javascript" > jQuery(function ($) { $("#fromtwo").tweet({ avatar_size: 16, // avatar size in px count: 10, // how many tweets to show username: ["google", "microsoft"], // define twitter usernames loading_text: "searching twitter...", }); }); </ script > <!-- DC Twitter Start --> < div id = "fromtwo" class = "query" style = "width:80%;" ></ div > <!-- DC Twitter End --> |
Display latest tweets from user "microsoft". Enable forward/backward buttons.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | <!-- DC Twitter Settings --> < script type = "text/javascript" > jQuery(function ($) { var options = { username: "microsoft", // define twitter usernames page: 1, avatar_size: 16, // avatar size in px count: 5, // how many tweets to show loading_text: "loading ..." }; var widget = $("#paging .widget"), next = $("#paging .next"), prev = $("#paging .prev"); var enable = function (el, yes) { yes ? $(el).removeAttr('disabled') : $(el).attr('disabled', true); }; var stepClick = function (incr) { return function () { options.page = options.page + incr; enable(this, false); widget.tweet(options); }; }; next.bind("checkstate", function () { enable(this, widget.find("li").length == options.count) }).click(stepClick(1)); prev.bind("checkstate", function () { enable(this, options.page > 1) }).click(stepClick(-1)); widget.tweet(options).bind("loaded", function () { next.add(prev).trigger("checkstate"); }); }); </ script > <!-- DC Twitter Start --> < div id = "paging" > < div class = "widget query" style = "width:80%;" ></ div > < div class = "controls" > < button class = "prev" type = "button" disabled>←</ button > < span class = "pagenum" ></ span > < button class = "next" type = "button" disabled>→</ button > </ div > </ div > <!-- DC Twitter End --> |
© TemplateAccess