johnson-pkt / twitcurl

Automatically exported from code.google.com/p/twitcurl
0 stars 0 forks source link

statusUpdate() method alwaysreturning true #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

When the statusUpdate() method is called, it always is returning true, even 
when the user or password is wrong.

What is the expected output? What do you see instead?

Yesterday it was working, but today I don't know if some twitter API has 
changed or something like that.

What version of the product are you using? On what operating system?

Using on Linux, the last version of twitcurl.

Please provide any additional information below.

In this code, bellow, the resuls is always the first option.

if( twitterObj.statusUpdate( tmpStr ) )
    {
        twitterObj.getLastWebResponse( replyMsg );
        printf( "\ntwitterClient:: twitCurl::updateStatus web 
response:\n%s\n", replyMsg.c_str() );
    }
    else
    {
        twitterObj.getLastCurlError( replyMsg );
        printf( "\ntwitterClient:: twitCurl::updateStatus error:\n%s\n", 
replyMsg.c_str() );
    }

Original issue reported on code.google.com by confuso...@gmail.com on 7 Jan 2010 at 1:10

GoogleCodeExporter commented 8 years ago
I have this issue as well and I cannot not seem to fix it ...

Original comment by castleva...@yahoo.com on 18 Jan 2010 at 6:47

GoogleCodeExporter commented 8 years ago
To both commentators - status update works that way. 

if( twitterObj.statusUpdate( tmpStr ) ) will return TRUE unless there is a curl 
error 

if you want to check for correct username and password, on error twitter will 
return 
you: 
<?xml version="1.0" encoding="UTF-8"?>
<hash>
  <request>/statuses/update.xml</request>
  <error>Could not authenticate you.</error>
</hash>

I think its good API overall. You yourself need to add some sort of XML 
parsing, 
which could be good to add in this library too. For example for these simple 
cases, 
e.g. isError() and getError == INVALID_USER_PASSWORD would be a good idea. :) 

Original comment by jbalodi...@gmail.com on 19 Jan 2010 at 6:35

GoogleCodeExporter commented 8 years ago
Any ideas? MiniXML could be added into the library, works well for me :D
About statusUptade(), I still do not know how to get it working :S
I'm studying libcurl to try to fix it, but it's not certain...

Original comment by confuso...@gmail.com on 20 Jan 2010 at 11:57

GoogleCodeExporter commented 8 years ago
Hi ,
As jbalodis83 mentioned in post (2), the twitCurl::statusUpdate() just returns 
true if 
cURL returns success; it returns false if cURL returns failure. The 
twitCurl::statusUpdate() does not actually return the twitter.com status. To 
know the 
twitter.com's result, you need to use twitCurl::getLastWebResponse(). The 
twitCurl::getLastWebResponse() gives the XML response sent by twitter.com. This 
XML 
response needs to be parsed to know the result of twitter API.

Original comment by swatkat....@gmail.com on 1 Apr 2010 at 5:20

GoogleCodeExporter commented 8 years ago

Original comment by swatkat....@gmail.com on 6 Mar 2011 at 3:54