Packagetwitter.api
Classpublic class Twitter
InheritanceTwitter Inheritance flash.events.EventDispatcher

This is a wrapper class around the Twitter public API. The pattern for all of the calls is to: 1.) Use XML for the format 2.) Internally handle the event from the REST call 3.) Parse the XML into a strongly typed object 4.) Publish a TwitterEvent whose payload is the type object from above



Public Methods
 MethodDefined by
  
Twitter
  
endSession():void
Twitter
  
follow(userId:String):void
Follows a user.
Twitter
  
Twitter
  
loadFeatured():void
Twitter
  
loadFollowers(lite:Boolean = true):void
Twitter
  
loadFollowersIds(user:String):void
Twitter
  
loadFriends(userId:String, lite:Boolean = true, page:int = 0):void
Loads a list of Twitter friends and (optionally) their statuses.
Twitter
  
loadFriendsIds(user:String):void
Twitter
  
loadFriendsTimeline(userId:String):void
Loads the timeline of all friends on Twitter.
Twitter
  
loadInfo(user:String):void
Twitter
  
Loads the timeline of all public users on Twitter.
Twitter
  
Twitter
  
loadReplies():void
Loads the most recent replies for the current authenticated user
Twitter
  
Twitter
  
loadUserTimeline(userId:String, count:int = 20, page:int = 1):void
Loads the timeline of a specific user on Twitter.
Twitter
  
search(query:TwitterSearch):void
Twitter
  
sendDirectMessage(recipientScreenName:String, message:String):void
Twitter
  
setAuthenticationCredentials(username:String, password:String):void
Sets the username and password for this instance, setting the flag to use https to true.
Twitter
  
setStatus(statusString:String):void
Sets user's Twitter status.
Twitter
  
showStatus(id:String):void
Returns a single status, specified by the id parameter below.
Twitter
  
updateLocation(location:String):void
Twitter
  
verify():void
Twitter
Public Constants
 ConstantDefined by
  ATOM_NS : Namespace
[static]
Twitter
Constructor detail
Twitter()constructor
public function Twitter()
Method detail
endSession()method
public function endSession():void
follow()method 
public function follow(userId:String):void

Follows a user. Right now this uses the /friendships/create/user.format

Parameters
userId:String
loadDirectMessages()method 
public function loadDirectMessages():void
loadFeatured()method 
public function loadFeatured():void
loadFollowers()method 
public function loadFollowers(lite:Boolean = true):voidParameters
lite:Boolean (default = true)
loadFollowersIds()method 
public function loadFollowersIds(user:String):voidParameters
user:String
loadFriends()method 
public function loadFriends(userId:String, lite:Boolean = true, page:int = 0):void

Loads a list of Twitter friends and (optionally) their statuses. Authentication required for private users.

Parameters
userId:String
 
lite:Boolean (default = true)
 
page:int (default = 0)
loadFriendsIds()method 
public function loadFriendsIds(user:String):voidParameters
user:String
loadFriendsTimeline()method 
public function loadFriendsTimeline(userId:String):void

Loads the timeline of all friends on Twitter. Authentication required for private users.

Parameters
userId:String
loadInfo()method 
public function loadInfo(user:String):voidParameters
user:String
loadPublicTimeline()method 
public function loadPublicTimeline():void

Loads the timeline of all public users on Twitter.

loadRateLimitStatus()method 
public function loadRateLimitStatus():void
loadReplies()method 
public function loadReplies():void

Loads the most recent replies for the current authenticated user

loadSentDirectMessage()method 
public function loadSentDirectMessage():void
loadUserTimeline()method 
public function loadUserTimeline(userId:String, count:int = 20, page:int = 1):void

Loads the timeline of a specific user on Twitter. Authentication required for private users.

Parameters
userId:String
 
count:int (default = 20)
 
page:int (default = 1)
search()method 
public function search(query:TwitterSearch):voidParameters
query:TwitterSearch
sendDirectMessage()method 
public function sendDirectMessage(recipientScreenName:String, message:String):voidParameters
recipientScreenName:String
 
message:String
setAuthenticationCredentials()method 
public function setAuthenticationCredentials(username:String, password:String):void

Sets the username and password for this instance, setting the flag to use https to true. Note that this will not work at all in Flash player 9.0.115, and will only work in later versions if the remote server has the allow-http-request-headers-from tag set permissively in its crossdomain policy file. For more information see: http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403184. Unfortunately Twitter has it set to (as of Sept 2008): which only lets in the twitter badges originating from twitter.com. Since that's the case, authentication will only work for AIR. If you use this for Flash in the browser, it will fail over to the browser's basic auth without an issue.

Parameters
username:String
 
password:String
setStatus()method 
public function setStatus(statusString:String):void

Sets user's Twitter status. Authentication required.

Parameters
statusString:String
showStatus()method 
public function showStatus(id:String):void

Returns a single status, specified by the id parameter below. The status's author will be returned inline.

Parameters
id:String
updateLocation()method 
public function updateLocation(location:String):voidParameters
location:String
verify()method 
public function verify():void
Constant detail
ATOM_NSconstant
public static const ATOM_NS:Namespace