Changes for page TwitterGroovy

Last modified by Ludovic Dubost on 2010/02/11 15:14

From version 4.1
edited by Ludovic Dubost
on 2008/12/31 10:01
Change comment: There is no comment for this version
To version 5.1
edited by Ludovic Dubost
on 2009/01/02 14:23
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -4,12 +4,20 @@
4 4  import twitter4j.Twitter;
5 5  
6 6  public class TwitterGroovy {
7 + TWitter twitter;
7 7  
8 - public Twitter getPublicTwitter() {
9 - return new Twitter();
9 + public Twitter getTwitter(twitterID, twitterPassword) {
10 + if (twitter!=null)
11 + return twitter;
12 +
13 + twitter = new Twitter(twitterID,twitterPassword);
14 + return twitter;
10 10   }
11 11  
12 - public Twitter getTwitter(twitterID, twitterPassword) {
13 - return new Twitter(twitterID,twitterPassword);
17 + public Document search(String text) {
18 + String url = "http://search.twitter.com/search.atom?q=" + text;
19 + def resp = twitter.get(url, true);
20 + def doc = resp.asDocument();
21 + return doc;
14 14   }
15 15  }