예제 #1
0
def listposts(service, blogid):
    feed = service.Get('/feeds/' + blogid + '/posts/default')
    for post in feed.entry:
        h = post.GetHtmlLink
        raise Exception(h.href)
        print post.GetEditLink().href.split(
            '/')[-1], post.title.text, "[DRAFT]" if is_draft(post) else ""
예제 #2
0
파일: blogger.py 프로젝트: sermmor/Blogodt
def getblogs(service):
    feed = service.Get('/feeds/default/blogs')
    for blog in feed.entry:
        yield (blog.GetSelfLink().href.split('/')[-1], blog.title.text)
예제 #3
0
파일: blogger.py 프로젝트: sermmor/Blogodt
    if not opts.username and not opts.dump:
        opts.username = raw_input("Username: "******"Specify file name")

        if opts.dump:
            dump_blogpost(args[0])
        else:
            title, content = read_blogpost(args[0], opts.rawhtml, opts.title)
            service = login(opts.username, opts.password)
            if opts.change:
                entry = service.Get('/feeds/%s/posts/default/%s' %
                                    (opts.blog, opts.change))
                update_entry(entry, title, content)
                service.Put(entry, entry.GetEditLink().href)
            else:
                service.Post(create_entry(title, content),
                             '/feeds/' + opts.blog + '/posts/default')
예제 #4
0
def lastpost(service, blogid):
    feed = service.Get('/feeds/' + blogid + '/posts/default')
    post = feed.entry[-1]
    hl = post.GetHtmlLink()
    return hl.href