/usr/share/php/Horde/Service/Twitter/Statuses.php is in php-horde-service-twitter 2.1.5-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | <?php
/**
* Horde_Service_Twitter_Statuses class for updating, retrieving user statuses.
*
* Copyright 2009-2015 Horde LLC (http://www.horde.org/)
*
* @author Michael J. Rubinsky <mrubinsk@horde.org>
* @license http://www.horde.org/licenses/bsd BSD
* @category Horde
* @package Service_Twitter
*/
class Horde_Service_Twitter_Statuses
{
/**
* Endpoint for status api requests
*
* @var string
*/
private $_endpoint = 'https://api.twitter.com/1.1/statuses/';
/**
* Format to use json or xml
*
* @var string
*/
private $_format = 'json';
/**
* Constructor
*
* @param Horde_Service_Twitter $twitter
*/
public function __construct($twitter)
{
$this->_twitter = $twitter;
}
/**
* Obtain the requested status
*
* @return string The method call results.
*/
public function show($id)
{
$url = $this->_endpoint . 'show.' . $this->_format;
return $this->_twitter->request->post($url, array('id' => $id));
}
/**
* Destroy the specified status update, obviously only if the current user
* is the author of the update.
*
* http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0destroy
*
* @param string $id The status id
*
* @return string
*/
public function destroy($id)
{
$url = $this->_endpoint . 'destroy.' . $this->_format;
return $this->_twitter->request->post($url, array('id' => $id));
}
/**
* Update the current user's status.
*
* @param string $status The new status text.
* @param array $params Any additional parameters.
* <pre>
* in_reply_to_status_id - the status id this tweet is in response to.
* </pre>
*
* @return string
*/
public function update($status, $params = array())
{
$url = $this->_endpoint . 'update.' . $this->_format;
$params['status'] = $status;
return $this->_twitter->request->post($url, $params);
}
/**
* Obtain the friendsTimeline.
*
* http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-friends_timeline
*
* NOTE: According to the API docs, this method is deprecated and will be
* going away in a future version of the API. This is to be replaced by
* home_timeline.
*
* http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-home_timeline
*
* @param array $params Parameters for the friends_timeline call
* <pre>
* since_id - Only tweets more recent the indicated tweet id
* max_id - Only tweets older then the indeicated tweet id
* count - Only return this many tweets (twitter limit = 200)
* page - The page number to return (note there are
* pagination limits)
* include_rts - Include retweets
* include_entities - Include twitter entities (will be mandatory in
* future twitter api release).
* </pre>
*
* @return string
*/
public function friendsTimeline($params = array())
{
$url = $this->_endpoint . 'friends_timeline.' . $this->_format;
return $this->_twitter->request->get($url, $params);
}
/**
* Returns the 20 most recent statuses, including retweets, posted by the
* authenticating user and that user's friends. This is the equivalent of
* /timeline/home on the Web.
*
* http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-home_timeline
*
* @param array $params Parameters for the friends_timeline call
* <pre>
* since_id - Only tweets more recent the indicated tweet id
* max_id - Only tweets older then the indeicated tweet id
* count - Only return this many tweets (twitter limit = 200)
* page - The page number to return (note there are pagination limits)
* </pre>
*
* @return string
*/
public function homeTimeline($params = array())
{
$url = $this->_endpoint . 'home_timeline.' . $this->_format;
return $this->_twitter->request->get($url, $params);
}
/**
* Returns the 20 most recent retweets posted by the authenticating user.
*
* @param array $params Parameters for the friends_timeline call
* <pre>
* since_id - Only tweets more recent the indicated tweet id
* max_id - Only tweets older then the indeicated tweet id
* count - Only return this many tweets (twitter limit = 200)
* page - The page number to return (note there are pagination limits)
* </pre>
*
* @return string
*/
public function retweetedByMe($params = array())
{
$url = $this->_endpoint . 'retweeted_by_me.' . $this->_format;
return $this->_twitter->request->get($url, $params);
}
/**
* Returns the 20 most recent retweets posted by the authenticating user's
* friends.
*
* @param array $params Parameters for the friends_timeline call
* <pre>
* since_id - Only tweets more recent the indicated tweet id
* max_id - Only tweets older then the indeicated tweet id
* count - Only return this many tweets (twitter limit = 200)
* page - The page number to return (note there are pagination limits)
* </pre>
*
* @return string
*/
public function retweetedToMe($params = array())
{
$url = $this->_endpoint . 'retweetedToMe.' . $this->_format;
return $this->_twitter->request->get($url, $params);
}
/**
* Returns the 20 most recent tweets of the authenticated user that have
* been retweeted by others.
*
* @param array $params Parameters for the friends_timeline call
* <pre>
* since_id - Only tweets more recent the indicated tweet id
* max_id - Only tweets older then the indeicated tweet id
* count - Only return this many tweets (twitter limit = 200)
* page - The page number to return (note there are pagination limits)
* </pre>
*
* @return string
*/
public function retweetsOfMe($params = array())
{
$url = $this->_endpoint . 'retweets_of_me.' . $this->_format;
return $this->_twitter->request->get($url, $params);
}
/**
* Retweets a tweet. Requires the id parameter of the tweet you are
* retweeting. Request must be a POST or PUT.
* Returns the original tweet with retweet details embedded.
*
* @params string id The id for the tweet that is being retweeted.
*
* @return string
*/
public function retweet($id)
{
$url = $this->_endpoint . 'retweet/' . $id . '.' . $this->_format;
return $this->_twitter->request->post($url, array());
}
/**
* Obtain the last 20 tweets from the public timeline. This is cached every
* 60 seconds on Twitter's servers so we should eventually ensure this is
* only actually requested every 60 seconds or greater.
*
* @return string
*/
public function publicTimeline()
{
$url = $this->_endpoint . 'public_timeline.' . $this->_format;
return $this->_twitter->request->get($url);
}
/**
* Obtain the friendsTimeline.
*
* http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-user_timeline
*
* @param array $params Parameters for the friends_timeline call
* <pre>
* id - For this user id or screen name.
* Current user if left out.
* user_id - Specfies the ID of the user for whom to return the
* user_timeline. Helpful for disambiguating when a valid
* user ID is also a valid screen name.
* screen_id - Specfies the screen name of the user for whom to return
* the user_timeline. Helpful for disambiguating when a
* valid screen name is also a user ID.
* since_id - Only tweets more recent the indicated tweet id
* max_id - Only tweets older then the indeicated tweet id
* count - Only return this many tweets (twitter limit = 200)
* page - The page number to return (note there are pagination limits)
* </pre>
*
* @return string
*/
public function userTimeline($params = array())
{
$url = $this->_endpoint . 'user_timeline.' . $this->_format;
return $this->_twitter->request->get($url, $params);
}
/**
* Obtain most recent 'mentions' for the current user. (i.e. all messages
* that contain @username in the text).
*
* http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-mentions
*
* @param array $params Parameters for the friends_timeline call
* <pre>
* since_id - Only tweets more recent the indicated tweet id
* max_id - Only tweets older then the indeicated tweet id
* count - Only return this many tweets (twitter limit = 200)
* page - The page number to return (note there are pagination limits)
* </pre>
*
* @return string
*/
public function mentions($params = array())
{
$url = $this->_endpoint . 'mentions_timeline.' . $this->_format;
return $this->_twitter->request->get($url, $params);
}
/**
* Returns a user's friends, each with current status inline. They are
* ordered by the order in which they were added as friends, 100 at a time.
*
* http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0friends
*
* @param array $params Parameters for the friends_timeline call
* <pre>
* id - For this user id or screen name.
* Current user if left out.
* user_id - Specfies the ID of the user for whom to return the
* user_timeline. Helpful for disambiguating when a valid
* user ID is also a valid screen name.
* screen_id - Specfies the screen name of the user for whom to return
* the user_timeline. Helpful for disambiguating when a
* valid screen name is also a user ID.
* page - The page number to return (note there are pagination limits)
* </pre>
* @return unknown_type
*/
public function friends($params = array())
{
$url = $this->_endpoint . 'friends.' . $this->_format;
return $this->_twitter->request->get($url, $params);
}
/**
* Returns a user's followers, each with current status inline. They are
* ordered by the order in which they were added as friends, 100 at a time.
*
* http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0friends
*
* @param array $params Parameters for the friends_timeline call
* <pre>
* id - For this user id or screen name.
* Current user if left out.
* user_id - Specfies the ID of the user for whom to return the
* user_timeline. Helpful for disambiguating when a valid
* user ID is also a valid screen name.
* screen_id - Specfies the screen name of the user for whom to return
* the user_timeline. Helpful for disambiguating when a
* valid screen name is also a user ID.
* page - The page number to return (note there are pagination limits)
* </pre>
* @return unknown_type
*/
public function followers($params = array())
{
$url = $this->_endpoint . 'followers.' . $this->_format;
return $this->_twitter->request->get($url, $params);
}
}
|