Google Groups

Re: [bloggerDev] How to put georss informations on a blogger post (Java)


Brett Morgan May 9, 2012 6:19 PM
Posted in group: Blogger Developer Group
Thanks Yoan!

On Mon, May 7, 2012 at 9:42 PM, Yoan <yoan.m...@gmail.com> wrote:
I found the solution if it can help somebody :

public static Entry createPost(
  GoogleService myService, String blogID, String title,
    String content, String userName)
    throws ServiceException, IOException {
// Create the entry to insert
Entry myEntry = new Entry();
myEntry.setTitle(new PlainTextConstruct(title));
myEntry.setContent(new PlainTextConstruct(content));

XmlBlob xml = new XmlBlob();
xml.addNamespace(new XmlNamespace("georss", "http://www.georss.org/georss"));
xml.addNamespace(new XmlNamespace("thr", "http://purl.org/syndication/thread/1.0"));
xml.setBlob("<thr:total>0</thr:total><georss:featurename>La Rochelle , Charente-Maritime, Poitou-Charentes, France</georss:featurename><georss:point>46.160337, -1.151138</georss:point>");
entry.setXmlBlob(xml);


// Ask the service to insert the new entry
URL postUrl = new URL("http://www.blogger.com/feeds/" + blogID + "/posts/default");
return myService.insert(postUrl, myEntry); 

Yoan

--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/bloggerdev/-/6ssMDMBmQAYJ.

To post to this group, send email to blogg...@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.



--

Brett Morgan

Developer Relations Engineer, Blogger