Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mauker1/twitter-php
Automatically exported from code.google.com/p/twitter-php
https://github.com/mauker1/twitter-php
Last synced: 9 days ago
JSON representation
Automatically exported from code.google.com/p/twitter-php
- Host: GitHub
- URL: https://github.com/mauker1/twitter-php
- Owner: Mauker1
- License: bsd-3-clause
- Created: 2016-02-01T02:33:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-01T02:36:11.000Z (almost 9 years ago)
- Last Synced: 2023-04-02T13:24:19.461Z (over 1 year ago)
- Language: PHP
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.txt
- License: license.txt
Awesome Lists containing this project
README
Twitter for PHP (c) David Grudl, 2008 (http://davidgrudl.com)
Introduction
------------Twitter for PHP is a very small and easy-to-use library for sending
messages to Twitter and receiving status updates.Project at GoogleCode: http://twitter-php.googlecode.com
Twitter's API documentation: http://groups.google.com/group/twitter-development-talk/web/api-documentation
My PHP blog: http://phpfashion.comRequirements
------------
- PHP (version 5 or better)
- cURL extensionUsage
-----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:foreach ($channel->status as $status) {
echo "message: ", $status->text;
echo "posted at " , $status->created_at;
echo "posted by " , $status->user->name;
}The authenticate() method tests if user credentials are valid:
if (!$twitter->authenticate()) {
die('Invalid name or password');
}Files
-----
readme.txt - This file.
license.txt - The license for this software (New BSD License).
twitter.class.php - The core Twitter class source.
send.php - Example sending message to Twitter.
load.php - Example loading statuses from Twitter.