Klávesové zkratky na tomto webu - rozšířené Na obsah stránky

Translate to English… Ins Deutsche übersetzen…

Twitter for PHP

Twitter for PHP is a very small and easy-to-use library for sending messages to Twitter and receiving status updates.

It requires PHP (version 5 or better) with cURL extension and is licensed under the New BSD License.

Usage

Create object using your credentials (user name and password)

$twitter = new Twitter($userName, $password);

The send() method updates your status. The message must be encoded in UTF-8:

$twitter->send('I am fine today.');

The load() method returns the 20 most recent status updates posted in the last 24 hours by you and optionally by your friends:

$withFriends = FALSE;
$channel = $twitter->load($withFriends);

The returned channel is a SimpleXMLElement object. Extracting the information from the channel is easy:

<ul>
<?foreach ($channel->status as $status): ?>
        <li><a href="http://twitter.com/<?=$status->user->screen_name?>"><?=$status->user->name?></a>:
        <?=$status->text?>
        <small>at <?=date("j.n.Y H:m", strtotime($status->created_at))?></small>
        </li>
<?endforeach?>
</ul>

You can obtain the latest development version from our subversion (SVN) repository.

(má angličtina je strašná, budu rád, když mě opravíte).

Komentáře RSS 2.0 komentářů » přidat

avatar

#1 Developer http://developer.xf.cz/blog nový

Nuže řekl sis o to.

Bude to asi dlouhý, klidně vymaž po opravě.

Twitter for PHP is a very small and easy-to-use library for sending messages to –the– Twitter and receiving statuses (lépe asi status updates).

Method send() updates your status. The message must be encoded in UTF-8: → The send() method updates your status. The message must be encoded in UTF-8.

Method load() returns the 20 most recent statuses posted in the last 24 hours from you and your friends (optionally). → The load() method returns the 20 most recent status updates posted in the last 24 hours by you and optionally by your friends.

The returned channel is a SimpleXMLElement object. Extracting the information–s– from the channel is easy:

Teď po náhledu jsem zjistil, že nevím jak se v Texy2 dělají přeškrtnutí (jsem zvyklý na jedničku), tak je to co má být umazáno označeno takhle –smaz me–.

Posláno 2. 7. 2008 ve 20.44 | Odpovědět
Na komentář reagoval [2] David Grudl
avatar

#2 David Grudl http://davidgrudl.com nový

#1 Developer: díky moc!

Posláno 2. 7. 2008 ve 21.45 | Odpovědět
avatar

#3 veena http://dvanula.cz nový

Díky Davide, zrovna Twitter chceme použít v jednom novém „omračujícím ;-)“ projektu. Tak jsi nám to jenom ulehčil!

Díky, pokud se projekt povede, pozvu tě na pivo ;-D

Posláno 3. 7. 2008 v 0.50 | Odpovědět
Na komentář reagoval [4] Inza
avatar

#4 Inza http://www.dvojmo.cz nový

#3 veena: Tak to nás bude víc, co dělají na “omračujících” projektech a pozvou tě na pivo:-)

Posláno 4. 7. 2008 ve 20.57 | Odpovědět
avatar

#5 Snuggles http://hufman.us nový

Your date() command should use “j.n.Y H:i” instead of “j.n.Y H:m”. Thank you for the excellent code!

Posláno 20. 8. 2008 ve 20.29 | Odpovědět

Zanechat komentář

  • na jiné komentáře odkazujte zápisem např. [2]
  • vaše IP bude zaznamenána a zobrazena
  • můžete použít Texy! syntaxi. HTML značky nejsou povolené. Příklad syntaxe: "text odkazu":odkaz, **tučně**, *kurzíva*, `code`
  • můžeme si tykat
  • diskuse mohou být řešeny metodou Indiana Jones
Text komentáře
Kontakt (povinné)

(maskuje se)




Výtah na začátek článku na první komentář

Názory čtenářů v diskusích nejsou názory provozovatele webu, a ten za jejich obsah neodpovídá.

TOPlist

phpFashion © 2004, 2008 David Grudlo webu

Jakékoliv užití obsahu, včetně převzetí článků nebo jejich částí, je bez předchozího písemného svolení autora zakázáno.

Ukázky zdrojových kódů smíte používat s uvedením autora a URL tohoto webu bez dalších omezení.

Tipy: Nafukovací čluny, lodě, kajaky, rafty | Navigace GPS | Spolehlivý obchod | Pevné zdraví, léky, afrodiziaka, fitness, lékárna | Parfémy | Dieta, hubnutí