Get Twitter User Icon Image URL library written in PHP.
Get Twitter User Icon Image URL library written in PHP.
You can work around API limitation get the image URL via the API, because it caches to memcached.
$twicon = new Twicon();
$twicon->out($twitterId, $size);
$twicon = new Twicon();
$src = $twicon->getIconUrl($id, $size);
echo '<img src="' . $src . '" alt="" />';
void Twicon:out ( int $id [,int $size = 0 ] )
Reedirect pure Twitter icon URL directly.
If referer page is SSL, redirect SSL icon url.
id
Twitter User ID
size
0: original 1: mini 2: normal 3: bigger
Returns none on success or dummy gif binary on failure.
mixed Twicon::getIconUrl ( int $id [,int $size = 0 [, bool $sslFlg = false ]] )
Returns Twitter icon URL string.
id
Twitter user ID
size
0: original 1: mini 2: normal 3: bigger
sslFlg
If you specify true, returns ssl url.
Returns Twitter icon URL on success or FALSE on failure.
bool Twicon::getMemcachedStatus ()
Returns connect memcached server status.
Returns TRUE on success or FALSE on failure.
config/memcached.ini
is optional memcached settings file(If it's none, using default settings).
You need to write settings in memcached
section.
host
memcached server host
port
memcached server port
cache_expire_sec
cache expire(second)
cache_prefix
data key prefix
The tests can be executed by using this command from the base directory.
phpunit --stderr --bootstrap tests/bootstrap.php tests/tests.php
Copyright (c) 2012 Hiroki Tanaka
The MIT License (MIT) http://www.opensource.org/licenses/MIT