List Info

Thread: Receiveving content of a blog post




Receiveving content of a blog post
country flaguser name
United States
2007-10-19 01:40:18
Hi,

I used example to recieve blog posts given here:
http://code.google.com/apis/blogge
r/developers_guide_java.html#RetrievingPosts

But I'm having trouble getting posts actual text..

              Entry entry = resultFeed.getEntries().get(i);
              System.out.println("t" + i+ "
"+entry.getXmlBlob());

Shouldn't getXmlBlob give me the xml of a post?
anyway,the returned XmlBlob object itself isn't null,but as
I try to
print getXmlBlob.getFullText() or any other get method,I get
null..

what am I doing wrong

Thanks in advance,Roland


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Blogger Data API" group.
To post to this group, send email to bloggerDevgooglegroups.com
To unsubscribe from this group, send email to
bloggerDev-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/bloggerDev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Receiveving content of a blog post
country flaguser name
United States
2007-10-22 17:03:50


On Oct 18, 11:40 pm, Roland <rolan...gmail.com> wrote:
> Hi,
>
> I used example to recieve blog posts given here:http://code.google.com/apis/blogger/deve
lopers_guide_java.html#Retrie...
>
> But I'm having trouble getting posts actual text..
>
>               Entry entry =
resultFeed.getEntries().get(i);
>               System.out.println("t" + i+
" "+entry.getXmlBlob());
>
> Shouldn't getXmlBlob give me the xml of a post?
> anyway,the returned XmlBlob object itself isn't
null,but as I try to
> print getXmlBlob.getFullText() or any other get
method,I get null..
>
> what am I doing wrong
>
> Thanks in advance,Roland



On Oct 18, 11:40 pm, Roland <rolan...gmail.com> wrote:
> Hi,
>
> I used example to recieve blog posts given here:http://code.google.com/apis/blogger/deve
lopers_guide_java.html#Retrie...
>
> But I'm having trouble getting posts actual text..
>
>               Entry entry =
resultFeed.getEntries().get(i);
>               System.out.println("t" + i+
" "+entry.getXmlBlob());
>
> Shouldn't getXmlBlob give me the xml of a post?
> anyway,the returned XmlBlob object itself isn't
null,but as I try to
> print getXmlBlob.getFullText() or any other get
method,I get null..
>
> what am I doing wrong
>
> Thanks in advance,Roland

There is a handy utility method called dump in the sample
code that
comes with the client library which will allow you to
convert the
entry to an XML and write it to an OutputStream. The method
you want
is in this file: http://gdata-java-client.goog
lecode.com/svn/trunk/java/sample/util/CommonUtils.java

If you copy the dump method into your class, you code might
look like
this:

import com.google.gdata.util.common.xml.XmlWriter;
...
    for (int i = 0; i < resultFeed.getEntries().size();
i++) {
      Entry entry = resultFeed.getEntries().get(i);
      .dump(entry, System.out);
      System.out.println();
    }

Does this give you what you want? I think this works well if
all you
want to do is write the XML string to a stream.

Happy coding,

Jeff


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Blogger Data API" group.
To post to this group, send email to bloggerDevgooglegroups.com
To unsubscribe from this group, send email to
bloggerDev-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/bloggerDev?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )