org.pandora.sense.twitter
Class Twitter

java.lang.Object
  extended by org.pandora.sense.BasicSense
      extended by org.pandora.sense.twitter.Twitter
All Implemented Interfaces:
Sense
Direct Known Subclasses:
TwitterDirectMessaging

public class Twitter
extends BasicSense

Enables receiving a sending messages through Twitter.


Field Summary
static int SLEEP
           
static int TREND_CHECK
           
 
Fields inherited from class org.pandora.sense.BasicSense
DEFAULT_SPEAKER, RETRY
 
Constructor Summary
Twitter()
           
Twitter(boolean enabled)
           
 
Method Summary
 void addFriend(java.lang.String friend)
          Add the follower.
 twitter4j.auth.RequestToken authorizeAccount()
          Authorise a new account to be accessible by Pandora.
 void authorizeComplete()
          Authorise a new account to be accessible by Pandora.
 void awake()
          Start sensing.
 void checkFollowers()
          Check followers.
 void checkProfile()
          Check profile for messages.
 void checkStatus()
          Check status.
 void checkTrends()
          Check trends.
 void connect()
           
 twitter4j.Twitter getConnection()
           
 java.util.List<java.lang.String> getFollowers()
          Return the list of followers names.
 java.util.List<java.lang.String> getFriends()
          Return the list of friends names.
 java.lang.String getOauthKey()
           
 java.lang.String getOauthSecret()
           
 java.lang.String getPassword()
           
 java.util.List<java.lang.String> getTimeline()
          Return the time-line.
 java.lang.String getToken()
           
 java.lang.String getTokenSecret()
           
 java.lang.String getUserName()
           
 void input(java.lang.Object input, Network network)
          Process the email message.
 void inputSentence(java.lang.String text, java.lang.String userName, java.lang.String targetUserName, Network network)
          Process the text sentence.
 void log(twitter4j.TwitterException exception)
           
 void output(Vertex output)
          Output the status or direct message reply.
 void outputTweet(java.lang.String tweet)
          Output the tweet if twitter is connected.
 void removeFriend(java.lang.String friend)
          Add the follower.
 void setConnection(twitter4j.Twitter connection)
           
 void setIsEnabled(boolean isEnabled)
          Allow the sense to disabled/enabled.
 void setOauthKey(java.lang.String oauthKey)
           
 void setOauthSecret(java.lang.String oauthSecret)
           
 void setPassword(java.lang.String password)
           
 void setToken(java.lang.String token)
           
 void setTokenSecret(java.lang.String tokenSecret)
           
 void setUserName(java.lang.String userName)
           
 void startCheckingProfile()
           
 void tweet(java.lang.String text)
          Tweet.
 
Methods inherited from class org.pandora.sense.BasicSense
getEmotionalState, getLanguageState, getName, getPandora, getPrimitive, getShortTermMemory, initialize, input, isEnabled, log, log, log, setEmotionalState, setLanguageState, setName, setPandora, shutdown, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SLEEP

public static int SLEEP

TREND_CHECK

public static int TREND_CHECK
Constructor Detail

Twitter

public Twitter(boolean enabled)

Twitter

public Twitter()
Method Detail

authorizeAccount

public twitter4j.auth.RequestToken authorizeAccount()
                                             throws twitter4j.TwitterException
Authorise a new account to be accessible by Pandora. Return the request token that contains the URL that the user must use to authorise twitter.

Throws:
twitter4j.TwitterException

authorizeComplete

public void authorizeComplete()
                       throws twitter4j.TwitterException
Authorise a new account to be accessible by Pandora.

Throws:
twitter4j.TwitterException

awake

public void awake()
Start sensing.

Specified by:
awake in interface Sense
Overrides:
awake in class BasicSense

setIsEnabled

public void setIsEnabled(boolean isEnabled)
Description copied from class: BasicSense
Allow the sense to disabled/enabled.

Specified by:
setIsEnabled in interface Sense
Overrides:
setIsEnabled in class BasicSense

startCheckingProfile

public void startCheckingProfile()

connect

public void connect()
             throws twitter4j.TwitterException
Throws:
twitter4j.TwitterException

checkProfile

public void checkProfile()
Check profile for messages.


addFriend

public void addFriend(java.lang.String friend)
Add the follower.


removeFriend

public void removeFriend(java.lang.String friend)
Add the follower.


checkStatus

public void checkStatus()
Check status.


getFollowers

public java.util.List<java.lang.String> getFollowers()
Return the list of followers names.


getTimeline

public java.util.List<java.lang.String> getTimeline()
Return the time-line.


getFriends

public java.util.List<java.lang.String> getFriends()
Return the list of friends names.


checkFollowers

public void checkFollowers()
Check followers.


log

public void log(twitter4j.TwitterException exception)

checkTrends

public void checkTrends()
Check trends.


tweet

public void tweet(java.lang.String text)
Tweet.


outputTweet

public void outputTweet(java.lang.String tweet)
Output the tweet if twitter is connected.


input

public void input(java.lang.Object input,
                  Network network)
Process the email message.

Specified by:
input in interface Sense
Overrides:
input in class BasicSense

output

public void output(Vertex output)
Output the status or direct message reply.

Specified by:
output in interface Sense
Overrides:
output in class BasicSense

getUserName

public java.lang.String getUserName()

setUserName

public void setUserName(java.lang.String userName)

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String password)

inputSentence

public void inputSentence(java.lang.String text,
                          java.lang.String userName,
                          java.lang.String targetUserName,
                          Network network)
Process the text sentence.


getOauthKey

public java.lang.String getOauthKey()

setOauthKey

public void setOauthKey(java.lang.String oauthKey)

getOauthSecret

public java.lang.String getOauthSecret()

setOauthSecret

public void setOauthSecret(java.lang.String oauthSecret)

getTokenSecret

public java.lang.String getTokenSecret()

setTokenSecret

public void setTokenSecret(java.lang.String tokenSecret)

getToken

public java.lang.String getToken()

setToken

public void setToken(java.lang.String token)

getConnection

public twitter4j.Twitter getConnection()

setConnection

public void setConnection(twitter4j.Twitter connection)