PHP Class Twitter, twitter-php

Afficher le fichier Open project: dg/twitter-php Class Usage Examples

Méthodes publiques

Свойство Type Description
$cacheDir string
$cacheExpire integer
$httpOptions array

Méthodes publiques

Méthode Description
__construct ( $consumerKey, $consumerSecret, $accessToken = NULL, $accessTokenSecret = NULL ) Creates object using consumer and access keys.
authenticate ( ) : boolean Tests if user credentials are valid.
cachedRequest ( $resource, array $data = NULL, $cacheExpire = NULL ) : stdClass | stdClass[] Cached HTTP request.
clickable ( stdClass $status ) : string Makes twitter links, @usernames and #hashtags clickable.
destroy ( $id ) : mixed Destroys status.
follow ( $username ) : stdClass Follows a user on Twitter.
load ( $flags = self::ME, $count = 20, array $data = NULL ) : stdClass[] Returns the most recent statuses.
loadUserFollowers ( $username, $count = 5000, $cursor, $cacheExpiry = null ) : stdClass Returns IDs of followers of a given user.
loadUserFollowersList ( $username, $count = 200, $cursor, $cacheExpiry = null ) : stdClass Returns list of followers of a given user.
loadUserInfo ( $username ) : stdClass Returns information of a given user.
loadUserInfoById ( $id ) : stdClass Returns information of a given user by id.
request ( $resource, $method, array $data = NULL, array $files = NULL ) : stdClass | stdClass[] Process HTTP request.
search ( $query, $full = FALSE ) : stdClass Returns tweets that match a specified query.
send ( $message, $media = NULL ) : stdClass Sends message to the Twitter.
sendDirectMessage ( $username, $message ) : stdClass Sends a direct message to the specified user.

Method Details

__construct() public méthode

Creates object using consumer and access keys.
public __construct ( $consumerKey, $consumerSecret, $accessToken = NULL, $accessTokenSecret = NULL )

authenticate() public méthode

Tests if user credentials are valid.
public authenticate ( ) : boolean
Résultat boolean

cachedRequest() public méthode

Cached HTTP request.
public cachedRequest ( $resource, array $data = NULL, $cacheExpire = NULL ) : stdClass | stdClass[]
$data array
Résultat stdClass | stdClass[]

clickable() public static méthode

Makes twitter links, @usernames and #hashtags clickable.
public static clickable ( stdClass $status ) : string
$status stdClass
Résultat string

destroy() public méthode

Destroys status.
public destroy ( $id ) : mixed
Résultat mixed

follow() public méthode

Follows a user on Twitter.
public follow ( $username ) : stdClass
Résultat stdClass see https://dev.twitter.com/rest/reference/post/friendships/create

load() public méthode

Returns the most recent statuses.
public load ( $flags = self::ME, $count = 20, array $data = NULL ) : stdClass[]
$data array
Résultat stdClass[]

loadUserFollowers() public méthode

Returns IDs of followers of a given user.
public loadUserFollowers ( $username, $count = 5000, $cursor, $cacheExpiry = null ) : stdClass
Résultat stdClass see https://dev.twitter.com/rest/reference/get/followers/ids

loadUserFollowersList() public méthode

Returns list of followers of a given user.
public loadUserFollowersList ( $username, $count = 200, $cursor, $cacheExpiry = null ) : stdClass
Résultat stdClass see https://dev.twitter.com/rest/reference/get/followers/list

loadUserInfo() public méthode

Returns information of a given user.
public loadUserInfo ( $username ) : stdClass
Résultat stdClass see https://dev.twitter.com/rest/reference/get/users/show

loadUserInfoById() public méthode

Returns information of a given user by id.
public loadUserInfoById ( $id ) : stdClass
Résultat stdClass see https://dev.twitter.com/rest/reference/get/users/show

request() public méthode

Process HTTP request.
public request ( $resource, $method, array $data = NULL, array $files = NULL ) : stdClass | stdClass[]
$data array
$files array
Résultat stdClass | stdClass[]

send() public méthode

Sends message to the Twitter.
public send ( $message, $media = NULL ) : stdClass
Résultat stdClass see https://dev.twitter.com/rest/reference/post/statuses/update

sendDirectMessage() public méthode

Sends a direct message to the specified user.
public sendDirectMessage ( $username, $message ) : stdClass
Résultat stdClass see https://dev.twitter.com/rest/reference/post/direct_messages/new

Property Details

$cacheDir public_oe static_oe property

public static string $cacheDir
Résultat string

$cacheExpire public_oe static_oe property

public static int $cacheExpire
Résultat integer

$httpOptions public_oe property

public array $httpOptions
Résultat array