Changes for page TwitterMacros

Last modified by Ludovic Dubost on 2009/01/02 17:09

From version 7.1
edited by Ludovic Dubost
on 2009/01/02 16:28
Change comment: There is no comment for this version
To version 9.1
edited by Ludovic Dubost
on 2009/01/02 16:42
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -2,9 +2,11 @@
2 2   * Twitter macros allowing to display twitter data
3 3   *#
4 4  
5 -#macro(twitter_display $list $withuser)
5 +#macro(twitter_display $list $nb $withuser)
6 +{pre}
6 6  <table>
7 7  #foreach($msg in $list)
9 +#if($velocityCount<$nb)
8 8  <tr>
9 9  <td style="border: 0px; border-bottom:1px dashed #D2DADA;">
10 10  #if($withuser)<a href="$msg.user.URL">$msg.user.name</a>#end $msg.text
... ... @@ -12,23 +12,25 @@
12 12  </td>
13 13  </tr>
14 14  #end
17 +#end
15 15  </table>
19 +{/pre}
16 16  #end
17 17  
18 18  
19 -#macro(twitter_search $text)
23 +#macro(twitter_search $text $nb)
20 20  #if(!$twitter)
21 21  #set($tg = $xwiki.parseGroovyFromPage("Twitter.TwitterGroovy", "Twitter.TwitterGroovy"))
22 22  #set($twitter = $tg.getTwitter("xwikiapi", "xwapi2008"))
23 23  #end
24 -#twitter_display($tg.search($text) true)
28 +#twitter_display($tg.search($text) $nb true)
25 25  #end
26 26  
27 -#macro(twitter_user $user)
31 +#macro(twitter_user $user $nb)
28 28  #if(!$twitter)
29 29  #set($tg = $xwiki.parseGroovyFromPage("Twitter.TwitterGroovy", "Twitter.TwitterGroovy"))
30 30  #set($twitter = $tg.getTwitter("xwikiapi", "xwapi2008"))
31 31  #end
32 -#twitter_display($twitter.getUserTimeline($user) false)
36 +#twitter_display($twitter.getUserTimeline($user) $nb false)
33 33  #end
34 34