1

This is a code for posting on a blog. It is my first try. I dont know what is the error in it. I am using proxy server and the error I'm getting is connection to server failed.

Can anyone help me out pleaseeeeeeeeee :/

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)

here is the traceback

here is the traceback file

   Traceback (most recent call last):
   File "C:\Python27\Lib\example.py", line 34, in <module>
   post.categories = (wp.getCategoryIdFromName('Python'),)
   File "C:\Python27\Lib\wordpresslib.py", line 332, in getCategoryIdFromName
   for c in self.getCategoryList():
   File "C:\Python27\Lib\wordpresslib.py", line 321, in getCategoryList
   self.user, self.password)
   File "C:\Python27\Lib\xmlrpclib.py", line 1224, in __call__
   return self.__send(self.__name, args)
  File "C:\Python27\Lib\xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "C:\Python27\Lib\xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "C:\Python27\Lib\xmlrpclib.py", line 1292, in single_request
    self.send_content(h, request_body)
  File "C:\Python27\Lib\xmlrpclib.py", line 1439, in send_content
    connection.endheaders(request_body)
  File "C:\Python27\Lib\httplib.py", line 954, in endheaders
    self._send_output(message_body)
  File "C:\Python27\Lib\httplib.py", line 814, in _send_output
    self.send(msg)
  File "C:\Python27\Lib\httplib.py", line 776, in send
    self.connect()
  File "C:\Python27\Lib\httplib.py", line 757, in connect
    self.timeout, self.source_address)
  File "socket.py", line 571, in create_connection
    raise err

error: [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
5
  • 1
    I hope this is not your actual password... Commented May 26, 2012 at 15:43
  • 1
    Edit the question to show the actual traceback you got Commented May 26, 2012 at 15:44
  • 1
    To expand on what Nick said... When you post questions about situations where your code is crashing, we always need to see a copy of the traceback/crash to help you identify the nature of the problem. Not everyone can figure it out just by looking at the code you are trying to run. Especially if its a custom library. If you make it a point to always include that info, you will be sure to get much faster and more accurate answers. Commented May 26, 2012 at 15:59
  • 1
    @lara Welcome to StackOverflow. It's frowned on here to post nearly-identical questions a few hours apart; just editing your old question with this new info would also bump it up to the top of the page, and would stop people from duplicating work someone else has already posted about in trying to solve your problem. Commented May 26, 2012 at 16:01
  • @Dougal Thanks for catching that one. It is the exact same code and connection issue. Helps me to stop looking into it. Commented May 26, 2012 at 16:11

1 Answer 1

1

From the looks of your site, the url you posted returns a 404 (not actually there). However, this does seem ready to receive POST requests: http://agneesa.wordpress.com/xmlrpc.php

I suggest you try checking that URL for accuracy.

This is what I get when I try your code with your original URL:

xmlrpclib.ProtocolError: <ProtocolError for \
    agneesa.wordpress.com/wordpress/xmlrpc.php: 404 Not Found>

This is what I get when I try it with the modified URL:

wordpresslib.WordPressException: \
    <WordPressException 403: 'Bad login/pass combination.'>

... obviously because thats not your real account info. In a nutshell, its possible your proxy could also be contributing to problems if its not set up to properly forward the request, but without us knowing specifics about your proxy config, there is no way to know for sure.

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

8 Comments

@jidi it is the same code but question is different i asked is there any problem with proxy server ??
@lara: Yes but in this current case, the url is a 404. So the proxy would have nothing to do with why you are having connection issues. Try fixing the URLs and then see if you have an issue. Im not sure why a proxy server would matter, if its configured to forward requests properly. If you are certain that is the correct URL, then my only guess is that your proxy is not forwarding the URL to the right place.
noooo... when i open this link it gives me this XML-RPC server accepts POST requests only.
@lara: Yes and thats what you would expect. You can't browse it directly. Its only expecting to receive POST requests, which is what your wordpress API is going to send. Im just confirming that YOUR url is not working, while the one I posted does work.
ohh okk.. so again problem problem is with my url... i have changed to correct one :( i m hating this :@ is there something wrong with my PC settings ?
|

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.