Changes for page TwitterMacros
Last modified by Ludovic Dubost on 2009/01/02 17:09
From version 1.1
edited by Ludovic Dubost
on 2009/01/02 15:18
on 2009/01/02 15:18
Change comment:
There is no comment for this version
To version 10.1
edited by Ludovic Dubost
on 2009/01/02 16:44
on 2009/01/02 16:44
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -2,12 +2,15 @@ 2 2 * Twitter macros allowing to display twitter data 3 3 *# 4 4 5 -#macro(twitter_display $list) 5 +#macro(twitter_display $list $nb $withuser) 6 +{pre} 6 6 <table> 7 -#foreach($msg in ) 8 +#foreach($msg in $list) 9 +#if($velocityCount<$nb) 8 8 <tr> 9 9 <td style="border: 0px; border-bottom:1px dashed #D2DADA;"> 10 -<a href="$msg.user.url">$msg.user.name</a> $msg.text 12 +#if($withuser)<a href="$msg.user.URL">$msg.user.name</a>#end $msg.text 13 +<br /> 11 11 <span style="color: #A2AAAA; font-size: 10px;">$xwiki.formatDate($msg.createdAt) #if($msg.source!="")from $msg.source #end</span> 12 12 </td> 13 13 </tr> ... ... @@ -14,21 +14,23 @@ 14 14 #end 15 15 #end 16 16 </table> 17 - 18 -#macro(twitter_search $text) 19 -#set($tg = $xwiki.parseGroovyFromPage("Twitter.TwitterGroovy", "Twitter.TwitterGroovy")) 20 -#set($twitter = $tg.getTwitter("xwikiapi", "xwapi2008")) 21 -#twitter_display($tg.search($text)) 20 +{/pre} 22 22 #end 23 23 24 -#macro(twitter_user $user) 23 + 24 +#macro(twitter_search $text $nb) 25 +#if(!$twitter) 25 25 #set($tg = $xwiki.parseGroovyFromPage("Twitter.TwitterGroovy", "Twitter.TwitterGroovy")) 26 26 #set($twitter = $tg.getTwitter("xwikiapi", "xwapi2008")) 27 -#twitter_display($twitter.getUserTimeline($user)) 28 28 #end 29 +#twitter_display($tg.search($text) $nb true) 30 +#end 29 29 30 -#macro(twitter_friends $user) 32 +#macro(twitter_user $user $nb) 33 +#if(!$twitter) 31 31 #set($tg = $xwiki.parseGroovyFromPage("Twitter.TwitterGroovy", "Twitter.TwitterGroovy")) 32 32 #set($twitter = $tg.getTwitter("xwikiapi", "xwapi2008")) 33 -#twitter_display($twitter.getFriendsTimeline($user)) 34 34 #end 37 +#twitter_display($twitter.getUserTimeline($user) $nb false) 38 +#end 39 +