Skip to content

class Twitter

Oliver edited this page Apr 25, 2020 · 1 revision

www/includes/twitter-php/Twitter.php


Twitter

Package

Default

Overview

Public Properties

cacheDir() | cacheExpire() | httpOptions() |

Constants

API_URL() | ME() | ME_AND_FRIENDS() | REPLIES() | RETWEETS() |

Public Methods

__construct() | authenticate() | cachedRequest() | clickable() | destroy() | follow() | load() | loadUserFollowers() | loadUserFollowersList() | loadUserInfo() | loadUserInfoById() | request() | search() | send() | sendDirectMessage() |

Constants

API_URL

API_URL = 'https://api.twitter.com/1.1/' :

www/includes/twitter-php/Twitter.php

ME

ME = 1 :

www/includes/twitter-php/Twitter.php

ME_AND_FRIENDS

ME_AND_FRIENDS = 2 :

www/includes/twitter-php/Twitter.php

REPLIES

REPLIES = 3 :

www/includes/twitter-php/Twitter.php

RETWEETS

RETWEETS = 128 :

www/includes/twitter-php/Twitter.php

Properties

cacheDir

public $cacheDir : string

Array

cacheExpire

public $cacheExpire : int

Array

consumer

private $consumer : \Twitter_OAuthConsumer

Array

httpOptions

public $httpOptions : array

Array

token

private $token : \Twitter_OAuthConsumer

Array

Methods

__construct()

Creates object using consumer and access keys.

public __construct(mixed $consumerKey, mixed $consumerSecret, mixed $accessToken = null, mixed $accessTokenSecret = null) : mixed

authenticate()

Tests if user credentials are valid.

public authenticate() : bool

cachedRequest()

Cached HTTP request.

public cachedRequest(mixed $resource, array $data = null, mixed $cacheExpire = null) : \stdClass|\stdClass[]

clickable()

Makes twitter links, @usernames and #hashtags clickable.

public clickable(\stdClass $status) : string static

destroy()

Destroys status.

public destroy(mixed $id) : mixed

follow()

Follows a user on Twitter.

public follow(mixed $username) : \stdClass

load()

Returns the most recent statuses.

public load(mixed $flags = self::ME, mixed $count = 20, array $data = null) : \stdClass[]

loadUserFollowers()

Returns IDs of followers of a given user.

public loadUserFollowers(mixed $username, mixed $count = 5000, mixed $cursor = -1, mixed $cacheExpiry = null) : \stdClass

loadUserFollowersList()

Returns list of followers of a given user.

public loadUserFollowersList(mixed $username, mixed $count = 200, mixed $cursor = -1, mixed $cacheExpiry = null) : \stdClass

loadUserInfo()

Returns information of a given user.

public loadUserInfo(mixed $username) : \stdClass

loadUserInfoById()

Returns information of a given user by id.

public loadUserInfoById(mixed $id) : \stdClass

request()

Process HTTP request.

public request(mixed $resource, mixed $method, array $data = null, array $files = null) : \stdClass|\stdClass[]

search()

Returns tweets that match a specified query.

public search(mixed $query, mixed $full = false) : \stdClass

send()

Sends message to the Twitter.

public send(mixed $message, mixed $media = null, mixed $options = []) : \stdClass

sendDirectMessage()

Sends a direct message to the specified user.

public sendDirectMessage(mixed $username, mixed $message) : \stdClass


\ » Classes » Twitter

Clone this wiki locally