Search This Site

Custom Search

Tuesday, May 4, 2010

Getting content from a designated post

Ques: I am curious to know if there is a program to provide access to allblogs and comments in real-time through an API. If possible I'mhoping to avoid writing bots and spiders. Please let me know at yourearliest convenience including anything on pricing and terms.
Hey,

If you still looking for a solution for the above i think i might have one, not sure if it is exactly what you looking for, but try it out anyways and let me know...

What i did got me the post content...

In the following section:
// Called when getBlogPostFeed() returns the list of blog posts
var handleBlogPostFeed = function(postsFeedRoot) {
var blogTitle = postsFeedRoot.feed.getTitle().getText();
var postEntry = postsFeedRoot.feed.getEntries()[0]; // only
get first post
var entryUri = postEntry.getSelfLink().getHref(); //
post's uri

I added a new variable declaration for the post content, heres the
code that you will place under the above directly:
var postContent = postEntry.getSummary().getText();

Now in the display section, coded as below:
// Get the blog post entry
bloggerService.getBlogPostEntry(entryUri,
function(postRoot) {
var postTitle = postRoot.entry.getTitle().getText();
content.innerHTML = '<p>Title of latest post to ' +
blogTitle + ': '
+ '<strong>"' + postTitle + '"</
strong></p>';
},

I replaced one thing, the "postTitle" with my variable to be as
follow:
// Get the blog post entry
bloggerService.getBlogPostEntry(entryUri,
function(postRoot) {
var postTitle = postRoot.entry.getTitle().getText();
content.innerHTML = '<p>Title of latest post to ' +
blogTitle + ': '
+ '<strong>"' + postContent + '"</
strong></p>';
},

This got me the content of my post...

However as you might notice, it was just a summary...still didn't figure a away to get the entire post...
Let me know if that was of any help...and let me know if you have found a better method...

Cheers...and good luck with your project....

No comments:

Post a Comment