1

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 ??

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

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

6 Comments

agneesa.wordpress.com it is correct and it exist... ohh let me try the XML .. no this password isnt write ;)
I did wht u have said and now the it is giving me this error :/ now i have to try something else ... IS MY CODE RIGHT OR I AM MISSING SOMETHING?? File "socket.py", line 553, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): gaierror: [Errno 11004] getaddrinfo failed
@lara I have added some more ideas to help you troubleshoot.
thanks a lot .. it is giving the same error i m using proxy server so do u thing it can cause this error??
Possibly. Something is getting in the way of your connection with the wordpress server... Do some research on that line? Others may be able to help if you ask a specific question on your set up.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.