python twitter
Details
| Last Update: | 2008-04-02 23:05:13 |
| Version: | python-twitter 0 |
| License/Program Type: | GPL (GNU General Public License) |
| Publisher: | DeWitt Clinton |
| Price: | $0.00 |
Description:
python-twitter is a Python wrapper around the Twitter API.
This library provides a pure python interface for the Twitter API.
Twitter provides a service that allows people to connect via the web, IM, and SMS. Twitter exposes a web services API and this library is intended to make it even easier for python programmers to use.
Building
From source:
Install the dependencies:
http://cheeseshop.python.org/pypi/simplejson
Download the latest python-twitter library from:
http://code.google.com/p/python-twitter/
Untar the source distribution and run:
$ python setup.py build
$ python setup.py install
Testing
With setuptools installed:
$ python setup.py test
Without setuptools installed:
$ python twitter_test.py
Usage:
The library provides a python wrapper around the Twitter API and the twitter data model.
Model:
The three model classes are twitter.Status, twitter.User, and twitter.DirectMessage. The API methods return instances of these classes.
To read the full API for twitter.Status, twitter.User, or twitter.DirectMessage, run:
$ pydoc twitter.Status
$ pydoc twitter.User
$ pydoc twitter.DirectMessage
API:
The API is exposed via the twitter.Api class.
To create an instance of the twitter.Api class:
>>> import twitter
>>> api = twitter.Api()
To create an instance of the twitter.Api with login credentials (many API calls required the client to be authenticated):
>>> api = twitter.Api(username='username', password='password)
To fetch the most recently posted public twitter status messages:
>>> statuses = api.GetPublicTimeline()
>>> print [s.user.name for s in statuses]
[u'DeWitt', u'Kesuke Miyagi', u'ev', u'Buzz Andersen', u'Biz Stone']
To fetch a single user's public status messages, where "user" is either a Twitter "short name" or their user id.
>>> statuses = api.GetUserTimeline(user)
>>> print [s.text for s in statuses]
To fetch a list a user's friends (requires authentication):
>>> users = api.GetFriends()
>>> print [u.name for u in users]
To post a twitter status message (requires authentication):
>>> status = api.PostUpdate(username, password, 'I love python-twitter!')
>>> print status.text
I love python-twitter!
There are many more API methods, to read the full API documentation:
$ pydoc twitter.Api
Requirements:
·
0 comments
Add to
python twitter Version History
Related Software
|
|
From category: Perl-Modules |
| OurCal::Setup is a Perl tutorial about how to set up OurCal.... |
|
|
From category: Libraries |
| Class::InsideOut 1.02 is libraries software developed by David A. Golden. Class::InsideOut is a Perl module with a safe, simple inside-out object construction kit. SYNOPSIS package... |
|
|
From category: Libraries |
| CGI::Wiki 0.62 is libraries software developed by Kake Pugh. CGI::Wiki is a toolkit for building Wikis. Helps you develop Wikis quickly by taking care of the boring bits for you. You will st... |
|
|
From category: Debuggers |
| Minibug is a simple debugger that runs in the console.... |
|
|
From category: Libraries |
| CAD::Drawing::GUI::View 0.01_01 is libraries software developed by Eric L. Wilhelm. CAD::Drawing::GUI::View are 2D graphics for CAD built on Tk::Zinc. This module provides methods to turn a... |
|
|
From category: Libraries |
| Algorithm::Networksort 1.05 is libraries software developed by John M. Gamble. Algorithm::Networksort can create inline comparisons for sorting. SYNOPSIS use Algorithm::Networksort... |
|
|
From category: Libraries |
| Audio::File::Type 0.10 is libraries software developed by Florian Ragwitz. Audio::File::Type represents an audio filetype. An instance of an object inherited from Audio::File::Type is return... |
|
|
From category: Libraries |
| DBIx::Wrapper 0.24 is libraries software developed by Don Owens. DBIx::Wrapper library is a Perl module that serves as a wrapper around DBI, providing additional functionality and convenience metho... |
|
|
From category: Libraries |
| gtkmm is a C++ interface for the popular GUI library GTK+.... |
|
|
From category: Libraries |
| libgnomeprint is a Gnome printing library.... |
|
|
From category: Libraries |
| APFP 04 is libraries software developed by Dennis Darland. APFP (Arbitrary Precision Floating Point) is an Unicon class for performing arbitrary precision floating point calculations. It als... |
|
|
From category: Libraries |
| DB_cart Class 1.13 is libraries software developed by Olaf Lederer. DB_cart Class is a MySQL shopping cart script that can be used with third party product catalogues and membership systems. The My... |
|
|
From category: Libraries |
| Chart::Graph 3.2 is libraries software developed by CAIDA Perl development team. Chart::Graph is a Perl extension for a front-end to gnuplot, XRT, and Xmgrace. SYNOPSIS EXAMPLE: gn... |
|
|
From category: Libraries |
| EarthMate Userland Library 1.0.10 is libraries software developed by Lonnie Mendez. The EarthMate Userland Library provides access to the USB device via libusb and POSIX threads. Installatio... |
|
|
From category: Assembler-Tools |
| cm Compilation Manager 0.5.1 is assembler tools software developed by Aaron Kimball. cm Compilation Manager is a new tool for build automation and compilation management. cm Compilation Manager add... |
Leave a comment