Twitter Tweets

Tweets are the atomic building blocks of Twitter, 140-character status updates with additional associated metadata. People tweet for a variety of reasons about a multitude of topics.

Figure 1a. Instantiate Tweets
$tweets = eden('twitter')->tweets('[TWITTER_KEY]', '[TWITTER_SECRET]', $_SESSION['access_token'], $_SESSION['access_secret']);
Figure 1b. Usage: Get Tweet
$tweets
	->includeEntities()		//optional
	->trimUser()			//optional
	->getTweet(123);
Figure 1c. Usage: Get Retweets
$tweets
	->includeEntities()		//optional
	->trimUser()			//optional
	->count(25)				//optional
	->getRetweets(123);
Figure 1d. Usage: Remove a Tweet
$tweets
	->includeEntities()		//optional
	->trimUser()			//optional
	->remove(123);
Figure 1e. Usage: Retweet
$tweets
	->includeEntities()		//optional
	->trimUser()			//optional
	->retweet(123);
Figure 1f. Usage: Tweet
$tweets
	->includeEntities()			//optional
	->trimUser()				//optional
	->displayCoordinates()		//optional
	->wrapLinks()				//optional
	->replyTo(456)				//optional
	->setLatitude('14.043')		//optional
	->setLongitude('14.043')	//optional
	->tweet('Hello Eden');
Figure 1g. Tweets Methods
Method Arguments Returns Description
$tweets->getRetweet($id);
  1. string|int
  2. - The numerical ID of the desired status
array Returns up to 100 of the first retweets of a given tweet.
$tweets->getTweet($id);
  1. string|int
  2. - The numerical ID of the desired Tweet.
array Returns a single Tweet, specified by the id parameter. The Tweet's author will also be embedded within the tweet.
$tweets->removeTweet($id);
  1. string|int
  2. - The numerical ID of the desired status.
array Destroys the status specified by the required ID parameter. The authenticating user must be the author of the specified status. Returns the destroyed status if successful.
$tweets->tweet($status);
  1. string
  2. - The text of your status update, typically up to 140 characters.
array Updates the authenticating user's current status, also known as tweeting.
$tweets->retweet($tweetId);
  1. string
  2. - The numerical ID of the desired status.
array Retweets a tweet. Returns the original tweet with retweet details embedded.
$tweets->tweetMedia($status, $media);
  1. string
  2. - The text of your status update, typically up to 140 characters.
  3. string
array Updates the authenticating user's current status and attaches media for upload. In other words, it creates a Tweet with a picture attached.
$tweets->inReplyToStatusId($statusId);
  1. string
Eden_Twitter_Tweets The ID of an existing status that the update is in reply to.
$tweets->setLatitude($latutide);
  1. float
Eden_Twitter_Tweets The latitude of the location this tweet refers to. This parameter will be ignored unless it is inside the range -90.0 to +90.0 (North is positive) inclusive. It will also be ignored if there isn't a corresponding long parameter.
$tweets->setLongtitude($longtitude);
  1. float
Eden_Twitter_Tweets The longitude of the location this tweet refers to. The valid ranges for longitude is -180.0 to +180.0 (East is positive) inclusive. This parameter will be ignored if outside that range, if it is not a number, if geo_enabled is disabled, or if there not a corresponding lat parameter.
$tweets->setPlaceId($placeId);
  1. string
Eden_Twitter_Tweets A place in the world. These IDs can be retrieved from GET geo/reverse_geocode.
$tweets->setCount($count);
  1. integer
Eden_Twitter_Tweets Specifies the number of records to retrieve. Must be less than or equal to 100.
$tweets->displayCoordinates(); none Eden_Twitter_Tweets When set to either true, t or 1, each tweet returned in a timeline will include a user object including only the status authors numerical ID
$tweets->trimUser(); none Eden_Twitter_Tweets When set to either true, t or 1, each tweet returned in a timeline will include a user object including only the status authors numerical ID
$tweets->includeEntities(); none Eden_Twitter_Tweets The entities node will be disincluded when set to false
$tweets->includeMyRetweet(); none Eden_Twitter_Tweets When set to either true, t or 1, any Tweets returned that have been retweeted by the authenticating user will include an additional current_user_retweet node, containing the ID of the source status for the retweet.
$tweets->possiblySensitive(); none Eden_Twitter_Tweets For content which may not be suitable for every audience.

© 2012 Openovate Labs. All rights reserved.