Log in

No account? Create an account
LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

LJ and Atom [Oct. 28th, 2004|03:41 pm]
LiveJournal Client Discussions
I am working on a perl client to post to LJ and Blogger using the Atom API. It has been like pulling teeth getting it to work, but I now have posting working through Atom in Blogger using the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://purl.org/atom/ns#">
<generator url="http://trevreport.org/blogForm.shtml">blogForm</generator>
<title mode="escaped" type="text/html">Test Title</title>
<content mode="escaped" type="text/html">Some Crazy Text</content>

When I send the POST request to the discovered atom URL (from the blog's HTML header) I get an Atom feed back, as if I sent a GET.

Can someone point out the obvious mistake I am making. If you want to see all the nitty gritty, the perl code is at http://trevreport.org/blogTest.txt .

Any help would be great!

[User Picture]From: vanbeast
2004-10-28 05:10 pm (UTC)
You're POSTing to the wrong URL.

The feed that's listed in the<link rel="alternate" ...> in the journal is the location for the Atom feed of the journal.

You need to POST to http://www.livejournal.com/interface/atomapi .

Even with that URL, though, I wasn't able to get your script to work. I know nothing about the Atom API though, so it might be something obvious that I just don't know about.
(Reply) (Thread)
[User Picture]From: quirrc
2004-10-28 06:52 pm (UTC)
(i guess) atom at lj is for reading only
(Reply) (Thread)
[User Picture]From: jproulx
2004-10-28 07:11 pm (UTC)

As I understand it:

username/data/atom returns the Atom syndication feed for the username, and includes a link to the service.feed, which you should use as the endpoint for your client.

The service feed returns the last 50 or so entries from a journal with service.edit URLs, and includes a URL for service.post.
(Reply) (Thread)
From: trevmex
2004-10-28 10:11 pm (UTC)

Re: As I understand it:

BINGO! You have answered my prayers. I have been searching everywhere to find that discovery info! This has really made my day, thank you for your help.

If anyone wants to cheat and not discover the URL it is:

Thanks again.
(Reply) (Parent) (Thread)
From: (Anonymous)
2005-01-25 08:33 pm (UTC)


did you ever get this to work in blogger?

-Rex <bloggerxml@rexroof.com>
(Reply) (Thread)
From: trevmex
2005-01-25 10:19 pm (UTC)

Re: blogger?

I did. Actually, I got it to work great in Blogger. The kicker is LJ. I haven't worked on it in a while though. http://trevreport.org/blogTest.txt is what I have so far. If you clean up all the testing crap, it will work perfectly in Blogger.

Have fun!
(Reply) (Parent) (Thread)