Logo Search packages:      
Sourcecode: pythoncard version File versions  Download package

def blogger::listPosts (   blogID,
  username,
  password,
  maxPosts = 20,
  serverURL = None 
)

List recent posts in your blog

Returns: list of dictionaries
    [{"dateCreated": date/time of this post in tuple format (see http://python.org/doc/lib/module-time.html)
      "userid": user who posted this entry,
      "postid": ID of this post,
      "content": text of this post
     }, ...]
    
    Posts are listed in chronological order, oldest to newest, so
    listPosts(...)[-1] is the newest post

Arguments:
- blogID: your weblog's ID number (see module docs for details)
- username: your weblog username
- password: your weblog password
- maxPosts: maximum number of posts to return
- serverURL: URL of remote server (optional, defaults to constants.xmlrpcServer)

Example:
>>> blogger.listPosts(my_blog_ID, "my_blogger_username", "my_blogger_password", 1)
# returns the most recent post

Notes:
- The Blogger server will only return the 20 most recent posts.

Definition at line 133 of file blogger.py.

00133                                                                       :
    """List recent posts in your blog
    
    Returns: list of dictionaries
        [{"dateCreated": date/time of this post in tuple format (see http://python.org/doc/lib/module-time.html)
          "userid": user who posted this entry,
          "postid": ID of this post,
          "content": text of this post
         }, ...]
        
        Posts are listed in chronological order, oldest to newest, so
        listPosts(...)[-1] is the newest post
    
    Arguments:
    - blogID: your weblog's ID number (see module docs for details)
    - username: your weblog username
    - password: your weblog password
    - maxPosts: maximum number of posts to return
    - serverURL: URL of remote server (optional, defaults to constants.xmlrpcServer)
    
    Example:
    >>> blogger.listPosts(my_blog_ID, "my_blogger_username", "my_blogger_password", 1)
    # returns the most recent post
    
    Notes:
    - The Blogger server will only return the 20 most recent posts.
    """
    server = xmlrpclib.Server(serverURL or constants.xmlrpcServer, constants.transport)
    response = server.blogger.getRecentPosts(constants.applicationKey,
        str(blogID),
        str(username),
        str(password),
        maxPosts)
    response.reverse()
    for i in range(len(response)):
        v = response[i]["dateCreated"].value
        response[i]["dateCreated"] = (int(v[:4]), int(v[4:6]), int(v[6:8]), int(v[9:11]), int(v[12:14]), int(v[15:17]), 0, 0, 0)
    return response
getRecentPosts = listPosts


Generated by  Doxygen 1.6.0   Back to index