API
index
tweetworks/API.py

Generate Tweetworks API requests and handle the response.
 
Nicolas Ward
@ultranurd
ultranurd@yahoo.com
http://www.ultranurd.net/code/tweetworks/
2009.06.19

 
Modules
       
lxml
os
sys
tweetworks
urllib
urllib2

 
Classes
       
API

 
class API
    Implement the Tweetworks API with HTTP POSTs.
 
In general, API methods are named for their URL, and are organized by type:
post-, group-, and user-related methods.
 
  Methods defined here:
__init__(self, api_key, username='', password='')
We need a Tweetworks API key to send requests. Optionally specify a
Tweetworks username and password to use those methods that require
authentication.
add_posts(self, body, group_id=None, parent_id=None, tweet=False)
Submits a post with the specified body text as the authenticated user.
The destination group ID is optional (if none, the post will be public);
the parent ID is optional (if none, the post will be top-level);
the post can be optionally sent to Twitter. If a parent ID is supplied
for a group post, the group ID is not necessary.
 
Requires authentication; post will originate from that user.
contributed_posts(self, username, sort_by_updated=False, pages=None, all=False, before_id=None, after_id=None)
Retrieves posts contributed by the specified user, selected by the
specified optional criteria.
 
Requires authentication from the specified user.
group_posts(self, group, sort_by_updated=False, pages=None, all=False, before_id=None, after_id=None)
Retrieves posts contained in the specified group, selected by the
specified optional criteria.
 
A private group requires authentication from a user in that group.
group_users(self, group, pages=None, all=False)
Retrieves all users who are members of the specified group, selected
by the specified optional criteria.
index_groups(self, pages=None, all=False)
Retrieves all Tweetworks groups, selected by the specified optional
criteria.
index_posts(self, sort_by_updated=False, pages=None, all=False, before_id=None, after_id=None)
Retrieves all posts, selected by the specified optional criteria.
index_users(self, pages=None, all=False)
Retrieves all Tweetworks users, selected by the specified optional
criteria.
join_groups(self, group)
Join the specified Tweetworks group as the authenticated user.
 
Requires authentication; the authenticated user will join the group.
joined_groups(self, username, pages=None, all=False)
Retrieves all groups of which the specified user is a member, selected
by the specified optional criteria.
 
Requires authentication from the specified user.
joined_groups_posts(self, username, sort_by_updated=False, pages=None, all=False, before_id=None, after_id=None)
Retrieves posts contained in all of the groups joined by the specified
user, selected by the specified optional criteria.
 
Requires authentication from the specified user.
search_groups(self, query)
Searches groups for the specified query string, including name,
description, and posts. Always returns all matches.
search_users(self, query)
Searches usernames and real names for the specified query string. Always
returns all matches.
view_posts(self, id)
Retrieves a single discussion and threaded list of replies.

Data and other attributes defined here:
TweetworksException = <class 'API.TweetworksException'>
Errors in handling Tweetworks API calls.