Rohmad Hidayat's Blog


My Notes on Mobile Technology, Python GUI, Python Web Framework, Software Development, Database, Server, Embedded System, Mini Computer

Kode Python CE sederhana untuk posting wordpress via Windows Mobile

import xmlrpclib

def getfile(filename):
filehandle = open(filename, “r”)
filecontents =
#textview.delete(“1.0”, “end”)
#textview.insert(“end”, filecontents)
return filecontents

def openfile():
import tkFileDialog

filename = tkFileDialog.askopenfilename()

return filename

user = ‘user’
passwd = ‘passwd’
server = xmlrpclib.ServerProxy(‘’)

blog_id = 0
#title = ‘Test Posting From Python LAgi’
title=raw_input(‘Judul Posting’)
#content = ‘test content, from python…tessssssss lagiii’
#content=raw_input(‘Isi Posting’)
fl=raw_input(‘Nama File’)
content=getfile(fl)+’Posted from My Mobile O2+Python
result = server.metaWeblog.getCategories(blog_id, user, passwd)

cat=raw_input(“PIlih ID Category= “)
blog_content = { ‘title’ : title, ‘description’ : content }
categories = [{‘categoryId’ : cat, ‘isPrimary’ : 1}]
#cat_id=raw_input(‘Category ID= ‘)
post_id = int(server.metaWeblog.newPost(blog_id, user, passwd, blog_content,1)), user, passwd, categories) # not work, user, passwd)
Posted from My Mobile O2+Python


Filed under: Uncategorized

One Response

  1. ipul says:

    manteb gan, kalo posting lewat php gimana ya gan

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: