posting on wordpress using python

It is my first attempt of any internet application. I am trying to post on my blog from a text document in my PC using python. My code is here

f = open('proofs.txt') 
data = f.readline()
print data
import wordpresslib
url = 'http://www.agnsa.wordpress.com/xmlrpc.php'
wp = wordpresslib.WordPressClient(url,'agnsa','pan@13579')
wp.selectBlog(0)
post = wordpresslib.WordPressPost()
post.title = 'try'
post.description = data
idPost = wp.newPost(post,True)

After running the module it is giving the error that connection failed to server. Here is the response. I tried to find about it but i couldnt understand how i can solve it. I never develop any such application before. It is simple but i cant understand what to do now…. Can any one give me suggestion what to do ??

Read More

Error is :

[Errno 10060] A connection attempt failed because the connected party did
not properly respond after a period of time, or established connection failed
because connected host has failed to respond

Related posts

Leave a Reply

1 comment

  1. A few pointers to help you troubleshoot:

    1. The domain http://www.agnsa.wordpress.com/ does not exist. Is this correct?
    2. On wordpress, XMLRPC is not turned on by default. Go to Settings->Writing->Remote Publishing and check the box for XML-RPC on your account. More info on XML-RPC Support.
    3. EDITED The correct path for XML RPC on wordpress, since you have a domain agneesa.wordpress.com would be http://agneesa.wordpress.com/wordpress/xmlrpc.php. See section on Endpoint.
    4. Have you just published your password? StackOverflow has a trustworthy and helpful community. But I am not sure I would trust the rest of the world 🙂

    If you have enable XML-RPC on the server side and the address in your comment is correct, then this code should work:

    import wordpresslib
    
    # dummy data to be on safe side
    data = "Post content, just ensuring data is not empty"
    
    url='http://agneesa.wordpress.com/wordpress/xmlrpc.php'
    # insert correct username and password
    wp=wordpresslib.WordPressClient(url,'agnsa','pan@13579')
    wp.selectBlog(0)
    post=wordpresslib.WordPressPost()
    post.title='try'
    post.description=data
    idPost=wp.newPost(post,True)
    

    The latest error suggests you cannot make a connection. It is either due to the wrong address in your code, or due to a failure on the side of the server (not accepting the connection for some reason). The same error was discussed in other questions on SO, here, here, and here — while they do not relate to the library you are using, browsing the answers and related questions may be helpful in giving you leads.