Search This Site

Custom Search

Monday, January 10, 2011

Re: [bloggerDev] newbie



On Mon, Jan 10, 2011 at 11:42 PM, arun kumar <arunkumar413@gmail.com> wrote:
Brett Morgan,
Thanks for the correction. As this is the first time i'm dealing with
an API, i'm getting some what confused with the atom and gdata
modules. The developers guide has only basic information. In the gdata
package i downloaded there is more documentation about the classes and
methods, but i'm not unable to understand them as there are no
examples for each of the methods.

please tell me the hierarchy of the modules,classes,methods

At about this point in time you are probably best served reading and understanding the source code to the gdata api itself. It is a reasonably light layer atop the gdata network protocol, which is an implementation of AtomPub.
 
Instead of creating new blog editor from scratch for editing the posts
I want  to use openoffice writer/web to create a new post and save it
as html. In the code i want to set the content_type as html and take
the content from the html file by using the open("filename.html"
"r").read()  function to post it to the blogger.

Is this possible? Does blogger takes html content?

You will need to parse the html file generated from OpenOffice for the core content that you require, and then upload that using your client. Blogger doesn't take entire html files as Blog posts, instead each post is a fragment of HTML.

Before you go down this path I must ask what it you are aiming to gain from authoring your blog posts in OpenOffice that you couldn't gain from the Blogger in Draft interface?
 

Thanks

Arun Kumar

On 1/10/11, Brett Morgan <brettmorgan@google.com> wrote:
> Heya Arun,
>
> I tidied up your code a touch, and now it prints out a list of my blogs.
>
> #!/usr/bin/python
>
> from gdata import service
> import gdata
> import atom
> import getopt
> import sys
>
> class Blogit:
> def __init__(self,email,password):
> # Authenticate using ClientLogin.
> self.service = service.GDataService(email, password)
> self.service.source = 'myblog_client-1.0'
> self.service.service = 'blogger'
> self.service.account_type = 'GOOGLE'
>      self.service.server = 'www.blogger.com'
>      self.service.ProgrammaticLogin()
>
> def PrintUserBlogTitles(self):
>      """Prints a list of all the user's blogs."""
> # Request the feed.
>      feed = self.service.Get('/feeds/default/blogs')
> # Print the results.
>      print feed.title.text
>      for entry in feed.entry:
>        print "\t" + entry.title.text
>
> def main():
> email=raw_input("enter the email:   ")
> password=raw_input("enter the password:  ")
> myblog = Blogit(email,password)
> myblog.PrintUserBlogTitles()
>
> if __name__ == '__main__':
> main()
>
>
> I strongly recommend Dive Into Python: http://diveintopython.org/
>
> brett
>
> On Sun, Jan 9, 2011 at 11:36 PM, arun kumar <arunkumar413@gmail.com> wrote:
>
>> Brett Morgan,
>>
>> Thanks for the link. I downloaded the example program and executed.
>> It listed my blogs and also posted a test post to my blog. I also
>> tried to write a similar program but it is not executing
>> properly.After entering the email and password, it waits for sometime
>> and the ends the execution. I'm attaching source file.
>>
>> I used:
>>  gdata-2.0.13
>> OS: Ubuntu 10.10
>> python version is 2.6.6
>>
>>
>> Thanks,
>> Arun Kumar
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Blogger Developer Group" group.
>> To post to this group, send email to bloggerdev@googlegroups.com.
>> To unsubscribe from this group, send email to
>> bloggerdev+unsubscribe@googlegroups.com<bloggerdev%2Bunsubscribe@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/bloggerdev?hl=en.
>>
>>
>
>
> --
> Brett Morgan
>
> *Developer Programs Engineer, Blogger*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Blogger Developer Group" group.
> To post to this group, send email to bloggerdev@googlegroups.com.
> To unsubscribe from this group, send email to
> bloggerdev+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/bloggerdev?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To post to this group, send email to bloggerdev@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.




--
Brett Morgan

Developer Programs Engineer, Blogger

--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To post to this group, send email to bloggerdev@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.

No comments:

Post a Comment