Wiki source code of TwitterMacros
Version 1.1 by Ludovic Dubost on 2009/01/02 15:18
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | #** | ||
2 | * Twitter macros allowing to display twitter data | ||
3 | *# | ||
4 | |||
5 | #macro(twitter_display $list) | ||
6 | <table> | ||
7 | #foreach($msg in ) | ||
8 | <tr> | ||
9 | <td style="border: 0px; border-bottom:1px dashed #D2DADA;"> | ||
10 | <a href="$msg.user.url">$msg.user.name</a> $msg.text | ||
11 | <span style="color: #A2AAAA; font-size: 10px;">$xwiki.formatDate($msg.createdAt) #if($msg.source!="")from $msg.source #end</span> | ||
12 | </td> | ||
13 | </tr> | ||
14 | #end | ||
15 | #end | ||
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)) | ||
22 | #end | ||
23 | |||
24 | #macro(twitter_user $user) | ||
25 | #set($tg = $xwiki.parseGroovyFromPage("Twitter.TwitterGroovy", "Twitter.TwitterGroovy")) | ||
26 | #set($twitter = $tg.getTwitter("xwikiapi", "xwapi2008")) | ||
27 | #twitter_display($twitter.getUserTimeline($user)) | ||
28 | #end | ||
29 | |||
30 | #macro(twitter_friends $user) | ||
31 | #set($tg = $xwiki.parseGroovyFromPage("Twitter.TwitterGroovy", "Twitter.TwitterGroovy")) | ||
32 | #set($twitter = $tg.getTwitter("xwikiapi", "xwapi2008")) | ||
33 | #twitter_display($twitter.getFriendsTimeline($user)) | ||
34 | #end |