Desinerd : Dipankar's Blog

Listing all your blogposts

Published: in Technical, , , , , , , by .

So here is a quick snapshot at how to get all your wordpress blogposts using python [or wordpresslib to be specific]

#!/usr/bin/env python
import wordpresslib
import tinyurl
wordpress = raw_input('Wordpress URL:')
user = raw_input('Username:')
password = raw_input('Password:')
# prepare client object
wp = wordpresslib.WordPressClient(wordpress, user, password)
# select blog id
posts = wp.getRecentPosts(100)
for p in posts:
if p.title.find("p=")<0:
    print p.title," - ",tinyurl.create_one(
Now that is real easy to use IMHO, i just started using this in one of my scripts. It is easy to use this and plug into other systems which use python !


Leave a Reply

Your email address will not be published. Required fields are marked *