4 Small example script that publish post with JPEG image
10 print 'Example of posting.'
13 wordpress
= raw_input('Wordpress URL:')
14 user
= raw_input('Username:')
15 password
= raw_input('Password:')
17 # prepare client object
18 wp
= wordpresslib
.WordPressClient(wordpress
, user
, password
)
23 # upload image for post
24 imageSrc
= wp
.newMediaObject('python.jpg')
28 post
= wordpresslib
.WordPressPost()
29 post
.title
= 'Test post'
30 post
.description
= '''
31 Python is the best programming language in the earth !
36 post
.categories
= (wp
.getCategoryIdFromName('Python'),)
39 idNewPost
= wp
.newPost(post
, True)
42 print 'posting successfull!'