Not a developer? Go to MovableType.com

Documentation

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=&quot;1.0&quot; encoding=&quot;utf-8&quot;?>
<feed xmlns=&quot;http://purl.org/atom/ns#&quot;>
  <link rel=&quot;alternate&quot; type=&quot;text/html&quot; href=&quot;http://example.typepad.com/weblog/&quot; />
  <title>Blog 1</title>
  <link rel=&quot;service.post&quot; href=&quot;http://www.typepad.com/t/atom/weblog/blog_id=1&quot; title=&quot;Blog 1&quot; type=&quot;application/x.atom+xml&quot; />
  <entry>
    <title>My First Post</title>
    <content mode=&quot;xml&quot;>Contents of my post</content>
    <issued>2003-10-23T18:35:51Z</issued>
    <link rel=&quot;alternate&quot; type=&quot;text/html&quot; href=&quot;http://example.typepad.com/weblog/2003/10/my_first_post.html&quot; />
    <id>tag:typepad.com,2003:post-3</id>
    <link rel=&quot;service.edit&quot; href=&quot;http://www.typepad.com/t/atom/weblog/blog_id=1/entry_id=3&quot; title=&quot;My First Post&quot; type=&quot;application/x.atom+xml&quot; />
  </entry>
  <entry>
    <title>My Second Post</title>
    <content mode=&quot;xml&quot;>Contents of my post</content>
    <issued>2006-01-23T18:35:51Z</issued>
    <link rel=&quot;alternate&quot; type=&quot;text/html&quot; href=&quot;http://example.typepad.com/weblog/2006/01/my_second_post.html&quot; />
    <id>tag:typepad.com,2006:post-4</id>
    <link rel=&quot;service.edit&quot; href=&quot;http://www.typepad.com/t/atom/weblog/blog_id=1/entry_id=4&quot; title=&quot;My Second Post&quot; type=&quot;application/x.atom+xml&quot; />
  </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;
Back

Leave a Comment