views:

37

answers:

2

If I have the ID of a post on a Blogger blog, how do I translate that ID into a URL which links to the post?

My ultimate goal is to pull posts from my Blogger site to my own site, and then be able to permalink to the actual posts. I'm doing this by parsing the RSS feed for my blog with Javascript. Unfortunately the "link" field in the RSS feed isn't a URL to the blog post... it's a URL to a feed of the comments. I can, however, grab the post ID, which I assumed would be a good way to find the post URL. Any other suggestions appreciated.

Edit: Upon further inspection, I found that the actual post link IS included in the RSS feed. The library I'm using to parse the RSS feed was giving me the wrong link. However, the main question still stands.

Edit: Still can't get a direct link. Here's an example of the links I get for a single entry:

<link rel=​"replies" type=​"application/​atom+xml" href=​"http:​/​/​chadsharpe.blogspot.com/​feeds/​2276618748913180797/​comments/​default" title=​"Post Comments">​
<link rel=​"replies" type=​"text/​html" href=​"https:​/​/​www.blogger.com/​comment.g?blogID=4528045192864780582&postID=2276618748913180797" title=​"2 Comments">​
<link rel=​"edit" type=​"application/​atom+xml" href=​"http:​/​/​www.blogger.com/​feeds/​4528045192864780582/​posts/​default/​2276618748913180797?v=2">​
<link rel=​"self" type=​"application/​atom+xml" href=​"http:​/​/​www.blogger.com/​feeds/​4528045192864780582/​posts/​default/​2276618748913180797?v=2">​
<link rel=​"alternate" type=​"text/​html" href=​"http:​/​/​feedproxy.google.com/​~r/​Funwhenwet/​~3/​PuX-Fqz_xKE/​sharpe-watson-bomb-chris-o-jimmy.html" title=​"Sharpe, Watson, Bomb, Chris O, Jimmy">

The URL I want is:

http://chadsharpe.blogspot.com/2010/08/sharpe-watson-bomb-chris-o-jimmy.html
+1  A: 

Well, this may be a lame answer but using the Feedburner feeds I get a direct link to my posts.

cbattlegear
It SHOULD be that easy, which is why I'm very confused. See my edits above for more info.
Alex Miller
A: 

What platform are you on Alex? Is using one of the GData APIs a potential path forward for you?

I'm curious about one thing, the link rel="alternate" type="text/html" link for your blog is pointing at feed burner. Do you have your blogger set up to redirect feeds through feedburner? For my test blog my alternate link for text/html links directly to blogspot.com:

<link rel="alternate" type="text/html" href="http://brettmorgan-test-blawg.blogspot.com/2010/10/hello-world.html" title="Hello world"/>
Brett Morgan