Search This Site

Custom Search

Sunday, January 9, 2011

Re: [bloggerDev] newbie

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.
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