Retrieving a list of entries
To obtain a list of the posts in a selected weblog you must first discover the Atom endpoint corresponding to that weblog. That is accomplished by inspecting the weblog’s autodiscovery document (see Atom Autodiscovery). Once you have the URL to the Atom endpoint, then send an authenticated HTTP GET request to that URL.
The response will be formatted as an Atom feed and will containing a list of 20 posts. There is no guarantee that the entries returned will be a complete representation of that resource. If you wish to edit any of the entries returned in this list, it is recommended that you retrieve the ‘service.edit’ URL associated with the entry and then retrieve the resource directly (see Retrieving a post on a weblog).
Sample Request
GET /t/atom/weblog/blog_id=1 HTTP/1.1
Host: www.typepad.com
X-WSSE: my credentials
Sample Response
HTTP/1.1 200 Content-Type: application/x.atom+xml
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://purl.org/atom/ns#">
<link rel="alternate" type="text/html" href="http://example.typepad.com/weblog/" />
<title>Blog 1</title>
<link rel="service.post" href="http://www.typepad.com/t/atom/weblog/blog_id=1" title="Blog 1" type="application/x.atom+xml" />
<entry>
<title>My First Post</title>
<content mode="xml">Contents of my post</content>
<issued>2003-10-23T18:35:51Z</issued>
<link rel="alternate" type="text/html" href="http://example.typepad.com/weblog/2003/10/my_first_post.html" />
<id>tag:typepad.com,2003:post-3</id>
<link rel="service.edit" href="http://www.typepad.com/t/atom/weblog/blog_id=1/entry_id=3" title="My First Post" type="application/x.atom+xml" />
</entry>
<entry>
<title>My Second Post</title>
<content mode="xml">Contents of my post</content>
<issued>2006-01-23T18:35:51Z</issued>
<link rel="alternate" type="text/html" href="http://example.typepad.com/weblog/2006/01/my_second_post.html" />
<id>tag:typepad.com,2006:post-4</id>
<link rel="service.edit" href="http://www.typepad.com/t/atom/weblog/blog_id=1/entry_id=4" title="My Second Post" type="application/x.atom+xml" />
</entry>
</feed>
Perl Code Sample
use XML::Atom::Client;
use XML::Atom::Entry;
my $api = XML::Atom::Client->new;
$api->username("YOUR USERNAME");
$api->password("YOUR PASSWORD");
my $uri = "http://www.typepad.com/t/atom/weblog/blog_id=130694";
my $feed = $api->getFeed($uri);
my @entries = $feed->entries;
my $i = 0;
foreach my $e (@entries) {
print ++$i . ". " . $e->title . "\n";
}
1;