dawoudt / twitcurl Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/twitcurl
Automatically exported from code.google.com/p/twitcurl
Hi i have replace dsw build against cmake so that you now can crosscompile, i
have also include <cstdlib> to compile it with gcc.
Original issue reported on code.google.com by [email protected]
on 21 Dec 2010 at 10:49
Attachments:
What steps will reproduce the problem?
1. Download source using svn
2. Use "make" command to build "libtwitcurl.so.1.0" (get error messages shown
below, but finishes build anyway)
3. Place "oauthlib.h" & "twitcurl.h" in /usr/local/include and place
"libtwitcurl.so.1.0" in /usr/local/lib.
4. Attempt to compile attached, simple program using g++ and get error messages
below. (all program tries to do is instantiate twitCurl object)
What is the expected output? What do you see instead?
Expected output of "make" command is clean make. Get following error messages:
g++ -Wall -fPIC -c -I/usr/include twitcurl.cpp oauthlib.cpp urlencode.cpp
base64.cpp HMAC_SHA1.cpp SHA1.cpp
In file included from oauthlib.cpp:2:0:
HMAC_SHA1.h: In constructor ‘CHMAC_SHA1::CHMAC_SHA1()’:
HMAC_SHA1.h:23:10: warning: ‘CHMAC_SHA1::AppendBuf2’ will be initialized
after [-Wreorder]
HMAC_SHA1.h:21:10: warning: ‘char* CHMAC_SHA1::SHA1_Key’ [-Wreorder]
HMAC_SHA1.h:34:3: warning: when initialized here [-Wreorder]
In file included from HMAC_SHA1.cpp:8:0:
HMAC_SHA1.h: In constructor ‘CHMAC_SHA1::CHMAC_SHA1()’:
HMAC_SHA1.h:23:10: warning: ‘CHMAC_SHA1::AppendBuf2’ will be initialized
after [-Wreorder]
HMAC_SHA1.h:21:10: warning: ‘char* CHMAC_SHA1::SHA1_Key’ [-Wreorder]
HMAC_SHA1.h:34:3: warning: when initialized here [-Wreorder]
HMAC_SHA1.cpp: In member function ‘void CHMAC_SHA1::HMAC_SHA1(BYTE*, int,
BYTE*, int, BYTE*)’:
HMAC_SHA1.cpp:32:31: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
HMAC_SHA1.cpp:49:31: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
g++ -shared -Wl,-soname,libtwitcurl.so.1 -Wl,-rpath-link=/usr/lib -L/usr/lib
-lcurl -o libtwitcurl.so.1.0 *.o
Expected output when compiling attached program using g++ is a clean compile.
Get following error messages:
/tmp/cc16seU4.o: In function `main':
twitter_test.cpp:(.text+0x17): undefined reference to `twitCurl::twitCurl()'
twitter_test.cpp:(.text+0x47): undefined reference to `twitCurl::~twitCurl()'
twitter_test.cpp:(.text+0x65): undefined reference to `twitCurl::~twitCurl()'
collect2: ld returned 1 exit status
What version of the product are you using? On what operating system?
Using latest version of twitcurl from svn. Operating system-Arch Linux
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 17 Jun 2011 at 1:40
Attachments:
What steps will reproduce the problem?
1. Attempt to compile twitcurl.cpp on a Linux system with gcc:
paracelsus@anduril:~/twitcurl-read-only$ g++ -I
"/home/paracelsus/twitcurl-read-only" -o twitcurl twitcurl.cpp
2. Corrected by adding #include "string.h" to twitcurl.cpp
3.
What is the expected output? What do you see instead?
twitcurl.cpp: In member function ‘void
twitCurl::clearCurlCallbackBuffers()’:
twitcurl.cpp:1335: error: ‘memset’ was not declared in this scope
paracelsus@anduril:~/twitcurl-read-only$ vim +1335 twitcurl.cpp
What version of the product are you using? On what operating system?
gcc version 4.4.1
Ubuntu Karmic, x86
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 14 Mar 2010 at 3:06
Twitcurl static library will be cause of linker errors with the VC's
precompiled header system.
Linker errors seems about standard c++ libraries routines.
How can I set my project's options to resolve this linker errors ?
Original issue reported on code.google.com by [email protected]
on 12 Jun 2011 at 3:57
What steps will reproduce the problem?
1. Call timelineUserGet()
2.
3.
What is the expected output? What do you see instead?
Expected user timeline information, received garbage.
What version of the product are you using? On what operating system?
Latest as of 5/3/2012.
Please provide any additional information below.
Here is part 1 of the fix. In twitCurl::timelineUserGet() the lines below used
to incorrectly use TWITCURL_URL_SEP_QUES instead of TWITCURL_URL_SEP_AMP.
if ( includeRetweets )
{
buildUrl += twitCurlDefaults::TWITCURL_URL_SEP_AMP + twitCurlDefaults::TWITCURL_INCRETWEETS;
}
if ( trimUser )
{
buildUrl += twitCurlDefaults::TWITCURL_URL_SEP_AMP + twitCurlDefaults::TWITCURL_TRIMUSER;
}
Part 2 of the fix is that TWITCURL_INCRETWEETS and TWITCURL_TRIMSUSER should be
defined as below with "=true" instead of "=1":
const std::string TWITCURL_TRIMUSER = "trim_user=true";
const std::string TWITCURL_INCRETWEETS = "include_rts=true";
Original issue reported on code.google.com by [email protected]
on 3 May 2012 at 9:31
What steps will reproduce the problem?
1. Download sources from SVN
2. Copy Makefile from SVN
2. Go into twitcurl-read-only directory
3. Type "make"
You got this output:
g++ -Wall -fPIC -c -I/usr/include twitcurl.cpp
twitcurl.h: In constructor ‘twitCurl::twitCurl()’:
twitcurl.h:190: warning: ‘twitCurl::m_twitterPassword’ will be initialized
after
twitcurl.h:175: warning: ‘std::string twitCurl::m_callbackData’
twitcurl.cpp:13: warning: when initialized here
twitcurl.h:186: warning: ‘twitCurl::m_proxyPassword’ will be initialized
after
twitcurl.h:183: warning: ‘std::string twitCurl::m_proxyServerIp’
twitcurl.cpp:13: warning: when initialized here
twitcurl.h:184: warning: ‘twitCurl::m_proxyServerPort’ will be initialized
after
twitcurl.h:178: warning: ‘bool twitCurl::m_curlProxyParamsSet’
twitcurl.cpp:13: warning: when initialized here
twitcurl.cpp: In member function ‘void
twitCurl::clearCurlCallbackBuffers()’:
twitcurl.cpp:1335: error: ‘memset’ was not declared in this scope
make: *** [target] Error 1
What is the expected output? What do you see instead?
Library should compile.
What version of the product are you using? On what operating system?
SVN version from date 9.6. 2010 on Gentoo Linux 2.6.32-gentoo-r7, using g++
compiler.
Please provide any additional information below.
I've made a diff file (diff newversion oldversion) to create a patch, now it
compiles well on Linux, too.
Original issue reported on code.google.com by [email protected]
on 9 Jun 2010 at 2:15
Attachments:
I started seeing this issue when porting my small project back over to Linux.
Timeline and direct message get methods work just fine and OAuth seems to work.
I altered my code to spit out my access_key and access_secret just to verify it
is pulling them from file correctly and also to print out the status string
just to make sure it is actually getting the full string from getline(). I also
modified the twitcurl.cpp code to have it spit out the postUrl, dataStr
(status), and OAuthHttpHeader to see if they provided any clues. Here is the
output from a failed status update attempt.
Enter selection: 1
59363265-2Ku8GIJjLYudQK8k6R320cc9hXiPufTcKCLY0BSqz
mRwsY4Fb0a5zXAGAVzeKkh4UIPlmsZ82PRev2nfj98
Status: status containing spaces
status containing spaces
http://api.twitter.com/1/statuses/update.xml
status=status%20containing%20spaces
Authorization: OAuth oauth_consumer_key="",oauth_nonce="1341337397163",oauth_sig
nature="HoGkNlFy3dJbkzGt7VBhOC0IzIw%3D",oauth_signature_method="HMAC-SHA1",oauth
_timestamp="1341337397",oauth_token="59363265-2Ku8GIJjLYudQK8k6R320cc9hXiPufTcKC
LY0BSqz",oauth_version="1.0"
I also used getLastWebResponse() to capture twitter's http response. It is
attached.
Anyone have any ideas on further debugging steps?
Original issue reported on code.google.com by [email protected]
on 3 Jul 2012 at 5:55
Hi,
i would suggest you to move the project to github to archive a better
collaboration with other developers, it's alot easier to fork do make pull
requests.
just a suggestion :)
regards,
Tristan
Original issue reported on code.google.com by [email protected]
on 17 Jun 2012 at 5:55
What steps will reproduce the problem?
1. download and and run twitterClient.exe -u username -p password (where
username and password are valid, tried two twitter accounts)
What is the expected output? What do you see instead?
2. "Do you want to visit twitter.com for PIN" (either choice seems to fail):
Saying no brings up a web response of <error>Could not authenticate with
OAuth.</error> and saying yes provides no URL to enter
I would expect the PIN to of course succeed automatically, or be provided with
a URL to enter in the respective scenarios.
What version of the product are you using? On what operating system?
latest twitterClient.exe
Please provide any additional information below.
I'm having the same set of issues trying to implement twitcurl in code with
keys created by myself.
Could anyone please help me identify if the problem is somehow on my end of
things? Any suggestions? Does twitterClient.exe (Still) work for anyone
reading this?
Thanks in advance!
Original issue reported on code.google.com by [email protected]
on 5 Jan 2012 at 6:59
What steps will reproduce the problem?
1. just compile the thing.
What is the expected output? What do you see instead?
Well, should be '0 errors, 0 warnings'
'oAuthHandlePIN' : is not a member of 'twitCurl'
'timelineUserGetTrim' : is not a member of 'twitCurl'
Those two functions do not exist any where in the project.
Original issue reported on code.google.com by [email protected]
on 7 May 2012 at 6:24
This is not an issue, but a feature request. It's weird that twitcurl which
seems to work perfectly fine with me doesn't support next cursor. Support next
cursor is seriously important feature.
Original issue reported on code.google.com by [email protected]
on 12 Dec 2012 at 7:02
When compiling I get these errors:
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external
symbol "void __cdecl std::_Xran(void)" (?_Xran@std@@YAXXZ) referenced in
function "public: void __thiscall twitCurl::setTwitterUsername(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > &)" (?setTwitterUsername@twitCurl@@QAEXAAV?
$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
Any idea whats going on?
Thanks
Original issue reported on code.google.com by [email protected]
on 21 Feb 2010 at 12:26
Cant set proxy if it does not have a password. I have changed your code to
this, I believe you should update it too:
void twitCurl::prepareCurlProxy()
{
if( !m_curlProxyParamsSet)
{
/* Reset existing proxy details in cURL */
curl_easy_setopt( m_curlHandle, CURLOPT_PROXY, NULL );
curl_easy_setopt( m_curlHandle, CURLOPT_PROXYUSERPWD, NULL
);
curl_easy_setopt( m_curlHandle, CURLOPT_PROXYAUTH,
(long)CURLAUTH_ANY );
/* Prepare username and password for proxy server */
std::string proxyIpPort( "" );
utilMakeCurlParams( proxyIpPort, getProxyServerIp(),
getProxyServerPort() );
curl_easy_setopt( m_curlHandle, CURLOPT_PROXY,
proxyIpPort.c_str() );
/* Proxy username and password */
if( m_proxyUserName.length() && m_proxyPassword.length() )
{
std::string proxyUserPass( "" );
utilMakeCurlParams( proxyUserPass,
getProxyUserName(), getProxyPassword() );
curl_easy_setopt( m_curlHandle,
CURLOPT_PROXYUSERPWD, proxyUserPass.c_str() );
}
/* Set the flag to true indicating that proxy info is set
in cURL */
m_curlProxyParamsSet = true;
}
}
Original issue reported on code.google.com by [email protected]
on 19 Jan 2010 at 6:38
I 'd like to use this library with my application.
Could you provide us a complete copyright terms in the SVN tree or document?
Thanks,
Original issue reported on code.google.com by [email protected]
on 4 Oct 2011 at 5:40
I have modified the statusUpdate() function to allow the inclusion of the
in_reply_to_status_id field:
twitcurl.h:
bool statusUpdate( std::string& newStatus, std::string& replyId /* in */ );
twitcurl.cpp:
bool twitCurl::statusUpdate( std::string& newStatus, std::string& replyId )
{
bool retVal = false;
if( newStatus.length() )
{
/* Prepare new status message */
std::string newStatusMsg = twitCurlDefaults::TWITCURL_STATUSSTRING + urlencode( newStatus );
if(!replyId.empty()) newStatusMsg.append("&in_reply_to_status_id="+replyId);
/* Perform POST */
retVal = performPost( twitCurlDefaults::TWITCURL_PROTOCOLS[m_eProtocolType] +
twitterDefaults::TWITCURL_STATUSUPDATE_URL +
twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType],
newStatusMsg );
}
return retVal;
}
Example usage:
std::string response;
std::string msg("@hippy2094 moo!");
std::string id("293032997593153536");
if(twitterObj.statusUpdate(msg,id)) {
twitterObj.getLastWebResponse(response);
qDebug(response.c_str());
}
To send a standard tweet, you just need to leave the replyId parameter empty.
Original issue reported on code.google.com by hippy2094
on 20 Jan 2013 at 7:39
What steps will reproduce the problem?
1. Using the makefile to build the library
2.
3.
What is the expected output? What do you see instead?
Using the makefile results in the below:
g++ -Wall -fPIC -c -I/usr/include twitcurl.cpp oauthlib.cpp urlencode.cpp
base64.cpp HMAC_SHA1.cpp SHA1.cpp
In file included from curl/curl.h:35:0,
from twitcurl.h:9,
from twitcurl.cpp:3:
curl/curlrules.h:79:4: error: #error "CURL_SIZEOF_LONG definition is missing!"
curl/curlrules.h:94:4: error: #error "CURL_TYPEOF_CURL_OFF_T definition is
missing!"
curl/curlrules.h:99:4: error: #error "CURL_FORMAT_CURL_OFF_T definition is
missing!"
curl/curlrules.h:104:4: error: #error "CURL_FORMAT_CURL_OFF_TU definition is
missing!"
curl/curlrules.h:109:4: error: #error "CURL_FORMAT_OFF_T definition is missing!"
curl/curlrules.h:114:4: error: #error "CURL_SIZEOF_CURL_OFF_T definition is
missing!"
curl/curlrules.h:119:4: error: #error "CURL_SUFFIX_CURL_OFF_T definition is
missing!"
curl/curlrules.h:124:4: error: #error "CURL_SUFFIX_CURL_OFF_TU definition is
missing!"
curl/curlrules.h:80:4: error: ‘Error’ does not name a type
curl/curlrules.h:153:6: error: ‘curl_off_t’ was not declared in this scope
curl/curlrules.h:153:6: error: ‘CURL_SIZEOF_CURL_OFF_T’ was not declared in
this scope
curl/curlrules.h:163:6: error: ‘curl_off_t’ was not declared in this scope
In file included from twitcurl.h:9:0,
from twitcurl.cpp:3:
curl/curl.h:237:3: error: ‘curl_off_t’ does not name a type
curl/curl.h:298:35: error: ‘curl_off_t’ has not been declared
make: *** [target] Error 1
What version of the product are you using? On what operating system?
Using Raspian on the Raspberry Pi.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 12 Jun 2013 at 12:21
In the file twitcurl.cpp line 2031 the string authorizeUrl2.c_str() should be
authorizeUrl.c_str()
Original issue reported on code.google.com by [email protected]
on 26 Aug 2011 at 9:52
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 5 Nov 2010 at 2:09
I started working on a project which uses twitcurl a few weeks ago.
In doing so, I made a number of changes to twitcurl, most of which I've
included here.
In reference to the patch file names:
ssl: Allows selection of either http or https in the same way as XML/Json can
be selected. The verifycred patch depends on this.
verifycred: Adds a method to call account/verify_credentials, this is useful
for getting user details following an OAuth authorisation without needing the
user to enter their username/id.
oauth-fix: At present the OAuth code includes all additional query fields used
to calculate the signature in the actual Authorization header. Twitter ignores
these but it's better to not send them.
This patch also fixes parsing of multi-field post data (needed for user
streams).
streamingapi: A somewhat bare-bones implementation of the user and public
streaming API.
async: Some code to make it less difficult to use twitcurl asynchronously.
misc: Fix ":" being sent to curl when the username and password are blank, and
NULL instead of "" being sent for the proxy parameter. These were causing
issues with SSL.
I've not really tested statuses/filter, however the other two streams work fine
and the code is largely identical.
So far I've only tested this on Windows.
No doubt there'll be some bug somewhere...
One thing I didn't include is fixes/replacements for statuses/public_timeline
and statuses/friends_timeline, which are now deprecated (the latter of which
has apparently been removed already), as I'm not sure about the compatibility
issues with existing code using the library.
Hope these are useful ^^
Regards,
Jonathan
Original issue reported on code.google.com by [email protected]
on 23 May 2012 at 6:59
Attachments:
What steps will reproduce the problem?
1. run make from a Debian Wheezy box, g++ (Debian 4.6.3-1) 4.6.3
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
The specific issues are:
- Initialization order of member variables in the ctor of CHMAC_SHA1
- Signed comparison issues.
I've attached a patch that fixes this.
Original issue reported on code.google.com by [email protected]
on 25 Apr 2012 at 4:47
Attachments:
What steps will reproduce the problem?
1. Functions such as followersIdsGet doesn't support next_cursor
What is the expected output? What do you see instead?
What expected is supporting nextcursor in the new api to help go through
pages/results
What version of the product are you using? On what operating system?
latest at the time of writing this issue,
Original issue reported on code.google.com by [email protected]
on 10 Dec 2012 at 7:19
What steps will reproduce the problem?
1. Compile the code in debug mode
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
i am using the latest library on windows
Please provide any additional information below.
I am getting "Unhandled exception at 0x00407b30 in OAuth.exe: 0xC0000005:
Access violation reading location 0xcccccccc." error at line
"twitterObj.getOAuth().setConsumerKey( std::string( "" ) );"
Can anybody please help.
Thanks and Regards,
Lokesh
Original issue reported on code.google.com by [email protected]
on 14 Jun 2011 at 12:28
I used twitcurl library to write a twitter-backend for Spectrum 2 (XMPP
gateway). I added a few additional functions needed for my application. I'm
attaching a patch containing these changes.
List of changes:
* oAuth::clone and twitCurl::clone to create clones of the object
* twitCurl::retweetById
* twitCurl::timelineHomeGet
* twitCurl::userLookUp (for bulk requests)
* modified twitCurl::directMessageGet to accept "sinceId" as a parameter
Original issue reported on code.google.com by [email protected]
on 4 Aug 2012 at 7:07
Attachments:
What steps will reproduce the problem?
1. Checkout, make, make install twitcurl
2. Modified the twitterClient.cpp removing search and destroy sections, leaving
in the section for tweeting and calling timelineUserGet
3. Compile and run twitterClient
What is the expected output? What do you see instead?
Tweet should be post and users timeline should be output. The tweet is pushed.
However, instead, I get:
<?xml version="1.0"
encoding="UTF-8"?><hash><request>/1/statuses/user_timeline.xml?count=200?include
_rts=1?trim_user=1</request><error>Not authorized</error></hash>
What version of the product are you using? On what operating system?
Latest from trunk this morning. Ubuntu Linux with GCC.
Original issue reported on code.google.com by [email protected]
on 18 Apr 2012 at 3:51
What steps will reproduce the problem?
I set 4 keys:
twitCurl twitterObj;
twitterObj.getOAuth().setConsumerKey(t_key);
twitterObj.getOAuth().setConsumerSecret(t_secret);
twitterObj.getOAuth().setOAuthTokenKey(t_accesstokenkey );
twitterObj.getOAuth().setOAuthTokenSecret( t_accesstokensecret );
twitterObj.accountVerifyCredGet()
What is the expected output? What do you see instead?
twitterObj.getLastWebResponse( replyMsg );
replyMsg return error 89:
<error code="89">Invalid or expired token</error>
What version of the product are you using? On what operating system?
r93. ubuntu 10.04
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 1 Dec 2012 at 3:34
This is related to another similar issue already posted. If you read the other
post, the recommended repair was to build from a curl source, and create
libcurl_imp.lib. I did that and I also added all the twitcurl source files to
my project. However, I still receive the same error.
1>twitcurl.obj : error LNK2019: unresolved external symbol __imp_curl_easy_init
referenced in function "public: __cdecl twitCurl::twitCurl(void)"
(??0twitCurl@@QEAA@XZ)
1>twitcurl.obj : error LNK2019: unresolved external symbol
__imp_curl_easy_cleanup referenced in function "public: __cdecl
twitCurl::~twitCurl(void)" (??1twitCurl@@QEAA@XZ)
1>twitcurl.obj : error LNK2019: unresolved external symbol
__imp_curl_easy_setopt referenced in function "private: void __cdecl
twitCurl::prepareCurlProxy(void)" (?prepareCurlProxy@twitCurl@@AEAAXXZ)
1>twitcurl.obj : error LNK2019: unresolved external symbol
__imp_curl_slist_free_all referenced in function "private: bool __cdecl
twitCurl::performGet(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(?performGet@twitCurl@@AEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$alloca
tor@D@2@@std@@@Z)
1>twitcurl.obj : error LNK2019: unresolved external symbol
__imp_curl_easy_perform referenced in function "private: bool __cdecl
twitCurl::performGet(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(?performGet@twitCurl@@AEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$alloca
tor@D@2@@std@@@Z)
1>twitcurl.obj : error LNK2019: unresolved external symbol
__imp_curl_slist_append referenced in function "private: bool __cdecl
twitCurl::performGet(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(?performGet@twitCurl@@AEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$alloca
tor@D@2@@std@@@Z)
1>twitcurl.obj : error LNK2019: unresolved external symbol
__imp_curl_easy_getinfo referenced in function "public: bool __cdecl
twitCurl::oAuthHandlePIN(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(?oAuthHandlePIN@twitCurl@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$al
locator@D@2@@std@@@Z)
1>C:\SkeletalBasicsVersions\SkeletonBasics-D2D\x64\Debug\SkeletonBasics-D2D.exe
: fatal error LNK1120: 7 unresolved externals
I am using Visual Studio 10 Professional. I really need help with this.
Thanks
Original issue reported on code.google.com by [email protected]
on 1 Aug 2012 at 4:23
What steps will reproduce the problem?
1. Sending certain characters to twitter API (Any character that has to be
percent encoding, except the blank space?).
What is the expected output? What do you see instead?
I'd expect twitter's server to accept my oauth signature but it hits me in the
face instead.
What version of the product are you using? On what operating system?
r88, this problem applies to both linux and wii (through devkitpro)
Please provide any additional information below.
The problem can be fixed by removing the urlencode() calls within
buildOAuthRawDataKeyValPairs() in oauth.cpp.
That is (according to https://dev.twitter.com/docs/auth/creating-signature )
how twitter says we have to do it. I don't know (did not check) if that's how
the oauth spec says it should be done but it is clearly how it works with
twitter.
Did you write oauthlib.cpp?
Original issue reported on code.google.com by paguiar32
on 22 Jun 2012 at 5:10
I want to plus http://dev.twitter.com/doc/get/trends/weekly this method into ur
API.I have tried to change the website in twitcurl.h.But It didn't work
Original issue reported on code.google.com by [email protected]
on 26 Dec 2010 at 6:03
Trying to get content of
this type of link
https://twitter.com/#!/search/?q=tcs
by twit curl
but unfortunately I found
twitterObj.search(sSearch)
this code is not searching from this
page and giving less number of search result than shebanged url.
is there any way to send requenst to this kind of twitter urls?
thanks,
Shankha
Original issue reported on code.google.com by [email protected]
on 24 Jun 2011 at 6:39
What version of the product are you using? On what operating system?
r88
Please provide any additional information below.
please add const to your function parameter
e.g.:
bool statusUpdate( std::string& newStatus /* in */ );
// you explicit write its an "in" parameter but dont write:
bool statusUpdate(const std::string& newStatus /* in */ );
//the problem with this is you cant write things like:
twit.statusUpdate("new msg");
Original issue reported on code.google.com by [email protected]
on 14 Jun 2012 at 7:34
Why do you declared it public if you didn't want libTwiturl users to use it ?
I think you should declare it private IMHO (please correct me if I am wrong)
Original issue reported on code.google.com by [email protected]
on 14 Sep 2011 at 8:33
Attachments:
What steps will reproduce the problem?
1. Using twitcurl methods
2.
3.
What is the expected output? What do you see instead?
<?xml version="1.0" encoding="UTF-8"?><errors> <error code="68">The Twitter
REST API v1 will soon stop functioning. Please migrate to API v1.1.
https://dev.twitter.com/docs/api/1.1/overview.</error></errors>
What version of the product are you using? On what operating system?
Please provide any additional information below.
This just started happening. What do I need to do to change?
Original issue reported on code.google.com by [email protected]
on 12 Jun 2013 at 6:30
What steps will reproduce the problem?
1. Download twitterClient_SRC2.zip
2. Get libs/libcurl.lib and libs/twitcurl.lib
3. Link this to a project in Code::Blocks (Project - Build options - Linker
settings)
4. Try to compile a program in Code::Blocks (using GNU GCC Complier)
What is the expected output? What do you see instead?
||=== twittout, Release ===|
obj\Release\main.o:main.cpp|| undefined reference to `twitCurl::twitCurl()'|
obj\Release\main.o:main.cpp|| undefined reference to `twitCurl::~twitCurl()'|
||=== Build finished: 2 errors, 0 warnings ===|
What version of the product are you using? On what operating system?
OS Windows
Please provide any additional information below.
Excuse me for my English. :)
Original issue reported on code.google.com by [email protected]
on 28 Sep 2011 at 11:39
Hello!
In the last update you added twitCurl::userLookup method and in this method you
are using std::min like this: std::min(100U, userInfo.size()).
This code doesn't compile on OSX (LLVM 4.0) with error saying of incompatible
types (unsigned int vs. unsigned long). Quick fix solution for this issue that
worked for me is to use std::min something like this: std::min(100UL,
userInfo.size()).
Original issue reported on code.google.com by [email protected]
on 29 Aug 2012 at 9:26
Hi,
first a big thanks for this piece of code. I detected some problems (incorrect
signature) calling twitter URLs that need authentication and use parameters
like count or since_id. I solved it by a small modification inside
twitCurl::performGet() based on the idea that m_oAuth.getOAuthHeader() passes
the parameters two times: inside getUrl and as dataStr. So I did a local copy
of getUrl which doesn't include the pars and this seems to work. Here's my
code, perhaps it helps ...
bool twitCurl::performGet( const std::string& getUrl )
{
std::string dataStr( "" );
std::string oAuthHttpHeader( "" );
struct curl_slist* pOAuthHeaderList = NULL;
/* Prepare standard params */
prepareStandardParams();
/* urlencode data */
std::string localUrl = getUrl;
size_t nPos = getUrl.find_first_of( "?" );
if( std::string::npos != nPos )
{
std::string dataKey( "" );
std::string dataValue( "" );
dataStr = getUrl.substr( nPos + 1 );
localUrl = getUrl.substr( 0, nPos );
nPos = dataStr.find_first_of( "=" );
if( std::string::npos != nPos )
{
dataKey = dataStr.substr( 0, nPos );
dataValue = dataStr.substr( nPos + 1 );
dataValue = urlencode( dataValue );
dataStr.assign( dataKey );
dataStr.append( "=" );
dataStr.append( dataValue );
}
}
/* Set OAuth header */
m_oAuth.getOAuthHeader( eOAuthHttpGet, localUrl, dataStr, oAuthHttpHeader );
if( oAuthHttpHeader.length() > 0 )
{
pOAuthHeaderList = curl_slist_append( pOAuthHeaderList, oAuthHttpHeader.c_str() );
if( pOAuthHeaderList )
{
curl_easy_setopt( m_curlHandle, CURLOPT_HTTPHEADER, pOAuthHeaderList );
}
}
/* Set http request and url */
curl_easy_setopt( m_curlHandle, CURLOPT_HTTPGET, 1 );
curl_easy_setopt( m_curlHandle, CURLOPT_URL, getUrl.c_str() );
/* Send http request */
if( CURLE_OK == curl_easy_perform( m_curlHandle ) )
{
if( pOAuthHeaderList )
{
curl_slist_free_all( pOAuthHeaderList );
}
return true;
}
if( pOAuthHeaderList )
{
curl_slist_free_all( pOAuthHeaderList );
}
return false;
}
Original issue reported on code.google.com by [email protected]
on 17 Oct 2010 at 3:19
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 [email protected]
on 7 Jan 2010 at 1:10
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 21 Aug 2012 at 6:52
What steps will reproduce the problem?
1. Any status update with url-encoded characters fails.
2. Example: twitCurl::statusUpdate("blah blah")
3. An authentication error is returned for any status updates containing
characters which will be url encoded (signature error).
What is the expected output? What do you see instead?
The status key/value is urlencoded twice before a signature is generated.
Currently pre-signature it is:
status%3Dblah%252520blah
Where instead it should be
status%3Dblah%2520blah
What version of the product are you using? On what operating system?
latest trunk, Windows 7, VS2010.
Please provide any additional information below.
Removing calls to urlencode in buildOAuthRawDataKeyValPairs should fix this
problem.
Original issue reported on code.google.com by [email protected]
on 14 Jun 2012 at 1:59
Downloaded and built twitcurl.lib from source without any problems however when
I attempt to include this newly built library into a new C++ workspace using
the same version of Visual Studio (VC++ 2005) I am seeing some Linker errors
and I am having a hell of a time figuring out why this is happening:
My header file for the Project that is attempting to use these libraries is
fairly simple:
//INCLUDE twitcurl
#include "twitcurl.h"
//INCLUDE curl
#include "curl/curl.h"
#include "curl/curlbuild.h"
#include "curl/curlrules.h"
#include "curl/curlver.h"
#include "curl/easy.h"
#include "curl/mprintf.h"
#include "curl/multi.h"
#include "curl/stdcheaders.h"
And the .cpp file simply creates and instance of twitCurl:
int main()
{ twitCurl twitterObj; return 0; }
Properties -> Linker -> Input -> Additional Dependencies =
I:\_Projects\common\libtwitcurl\debug\twitcurl.lib
I:\_Projects\common\libtwitcurl\lib\libcurl.lib
This is what I get when I attempt to build this project:
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol
__imp__curl_easy_init referenced in function "public: __thiscall
twitCurl::twitCurl(void)" (??0twitCurl@@QAE@XZ)
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol
__imp__curl_easy_cleanup referenced in function "public: __thiscall
twitCurl::~twitCurl(void)" (??1twitCurl@@QAE@XZ)
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol
__imp__curl_easy_setopt referenced in function "private: void __thiscall
twitCurl::prepareCurlProxy(void)" (?prepareCurlProxy@twitCurl@@AAEXXZ)
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol
__imp__curl_slist_free_all referenced in function "private: bool __thiscall
twitCurl::performGet(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(?performGet@twitCurl@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocato
r@D@2@@std@@@Z)
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol
__imp__curl_easy_perform referenced in function "private: bool __thiscall
twitCurl::performGet(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(?performGet@twitCurl@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocato
r@D@2@@std@@@Z)
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol
__imp__curl_slist_append referenced in function "private: bool __thiscall
twitCurl::performGet(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(?performGet@twitCurl@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocato
r@D@2@@std@@@Z)
1>twitcurl.lib(twitcurl.obj) : error LNK2019: unresolved external symbol
__imp__curl_easy_getinfo referenced in function "public: bool __thiscall
twitCurl::oAuthHandlePIN(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(?oAuthHandlePIN@twitCurl@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allo
cator@D@2@@std@@@Z)
1>D:\Projects VS05\TestTwitterAPI\Debug\TestTwitterAPI.exe : fatal error
LNK1120: 7 unresolved externals
I am stuck on this and it is extremely frustrating!
Original issue reported on code.google.com by [email protected]
on 29 Nov 2011 at 7:38
I'd like to propose three enhancements:
1. Support the Streaming API. I believe this can be done via libcurl, but I
haven't tried it yet.
2. Return objects in JSON format in addition to or instead of XML. JSON is
much more compact, and quite a few modern "non-SQL" databases store objects
in JSON format, eliminating a conversion step.
3. Create SWIG ".i" files for the library. SWIG http://www.swig.org/ is a
wrapper generator. If you create interface .i files, SWIG can generate
wrapper code for nearly all higher-level languages, including Perl, PHP,
Ruby, Lisp, Scheme, Java and R.
I'm going to be working independently on 1. - I haven't had much experience
with libcurl, but I do have wrappers for Perl and R, so I don't need to
work in C/C++. I am not a C++ programmer, so I wouldn't be able to submit
patches for 2. or 3.
Original issue reported on code.google.com by [email protected]
on 20 Jan 2010 at 6:07
Just a note.
The second sample only works when code is checked out from trunk.
A mention that it uses PIN does not really clarify that it is the trunk.
Original issue reported on code.google.com by [email protected]
on 5 Aug 2011 at 7:26
What steps will reproduce the problem?
1. Download, make and make install twitcurl on Ubuntu Oninit Ocelot
2. Try to compile a consumer of twitcurl using g++ source.cpp -o output
-ltwitcurl provides an error stating that libtwitcurl can't link against curl
What is the expected output? What do you see instead?
The make / make install should work on ubuntu
What version of the product are you using? On what operating system?
latest libtwitcurl on latest Ubuntu
Please provide any additional information below.
I resolved this issue by changing to G++ call in your Makefile to:
$(CC) -shared -Wl,-soname,lib$(LIBNAME).so.1 $(LDFLAGS) -o lib$(LIBNAME).so.1.0 *.o -L$(LIBRARY_DIR) -lcurl
Original issue reported on code.google.com by [email protected]
on 23 Apr 2012 at 9:45
Hi,
Thanks for your great job.
It seem the code is no long update anymore. And there are some problem on
directmessage new, friendship create/destroy. So I tried to fix this problem,
and it worked.
So I think maybe some one may need my code...
(so many people asked questions on twitter-dev-talk about this lib)
Original issue reported on code.google.com by [email protected]
on 3 Nov 2010 at 4:10
I'm using twitCurl::timelineUserGet() function, but I found that the
occurrences of "TWITCURL_URL_SEP_QUES" in this function should be replaced by
"TWITCURL_URL_SEP_AMP", otherwise, the generated url is wrong.
Original issue reported on code.google.com by [email protected]
on 15 Feb 2012 at 5:25
What steps will reproduce the problem?
1. Download source from svn: svn checkout
http://twitcurl.googlecode.com/svn/trunk/ twitcurl-read-only
2. Compile libtwitcurl: make
Produces these errors:
libtwitcurl$ make
g++ -Wall -fPIC -c -I/usr/include twitcurl.cpp oauthlib.cpp urlencode.cpp
base64.cpp HMAC_SHA1.cpp SHA1.cpp
HMAC_SHA1.h: In constructor ‘CHMAC_SHA1::CHMAC_SHA1()’:
HMAC_SHA1.h:23: warning: ‘CHMAC_SHA1::AppendBuf2’ will be initialized after
HMAC_SHA1.h:21: warning: ‘char* CHMAC_SHA1::SHA1_Key’
HMAC_SHA1.h:34: warning: when initialized here
HMAC_SHA1.h: In constructor ‘CHMAC_SHA1::CHMAC_SHA1()’:
HMAC_SHA1.h:23: warning: ‘CHMAC_SHA1::AppendBuf2’ will be initialized after
HMAC_SHA1.h:21: warning: ‘char* CHMAC_SHA1::SHA1_Key’
HMAC_SHA1.h:34: warning: when initialized here
HMAC_SHA1.cpp: In member function ‘void CHMAC_SHA1::HMAC_SHA1(BYTE*, int,
BYTE*, int, BYTE*)’:
HMAC_SHA1.cpp:32: warning: comparison between signed and unsigned integer
expressions
HMAC_SHA1.cpp:49: warning: comparison between signed and unsigned integer
expressions
3. Creating library (this is on OSX 10.5.8): g++ -dynamiclib
-Wl,-dylib_install_name -L/usr/lib -o libtwitcurl.dylib *.o -lcurl
Undefined symbols:
"CHMAC_SHA1::HMAC_SHA1(unsigned char*, int, unsigned char*, int, unsigned char*)", referenced from:
oAuth::getSignature(_eOAuthHttpRequestType, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)in oauthlib.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
What is the expected output? What do you see instead?
- See above
What version of the product are you using? On what operating system?
- Apple Macintosh G4 running OSX 10.5.8
Please provide any additional information below.
- Looks like the order in which object files are presented to ld is wrong.
Putting HMAC_SHA1.o to the end seems to solve the issue.
Original issue reported on code.google.com by [email protected]
on 18 Jan 2012 at 3:33
What steps will reproduce the problem?
1. Call statusDestroyById( std::string& statusId )
2.
3.
What is the expected output? What do you see instead?
Confirmation or error associated with the destruction of a status.
What version of the product are you using? On what operating system?
Latest as of 5/4/2012.
Please provide any additional information below.
Here is the fix, a colon ':' must be added to the buildUrl:
bool twitCurl::statusDestroyById( std::string& statusId )
{
bool retVal = false;
if ( statusId.length() )
{
/* Prepare URL */
std::string buildUrl = twitterDefaults::TWITCURL_STATUDESTROY_URL + twitCurlDefaults::TWITCURL_COLON + statusId +
twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType];
/* Perform DELETE */
retVal = performDelete( buildUrl );
}
return retVal;
}
Original issue reported on code.google.com by [email protected]
on 4 May 2012 at 5:10
The getOAuthHeader method doesn't take into account that there may be more than
one query string value or more than one post value and as such, if you put more
than one in, the signature will not get generated properly.
I found this by extending twitcurl to allow reply functionality where you must
pass in a second post variable to signify what id you are replying to. I also
had the problem with the query string trying to set the optional parameters to
return entities.
I got it to work and here are the code modifications I used. Basically all I
did was add a method to parse the key value pair to a map and then use that
data for the signature. It looks at both url and post data and combines them
into one map. I know this can be simplified and needs a bit of refactoring,
but it works. I also passed a blank string to buildOAuthTokenKeyValuePairs for
the rawData since I am parsing it and adding it to the rawKeyValuePairs. It
made more sense to me to do all the parsing at once instead of haivng the
buildOAuthTokenKeyValuePairs method parse the rawData.
bool oAuth::getOAuthHeader( const eOAuthHttpRequestType eType,
const std::string& rawUrl,
const std::string& rawData,
std::string& oAuthHttpHeader,
const bool includeOAuthVerifierPin )
{
oAuthKeyValuePairs rawKeyValuePairs;
std::string rawParams( "" );
std::string oauthSignature( "" );
std::string paramsSeperator( "" );
std::string pureUrl( rawUrl );
/* Clear header string initially */
oAuthHttpHeader.assign( "" );
rawKeyValuePairs.clear();
/* If URL itself contains ?key=value, then extract and put them in map */
size_t nPos = rawUrl.find_first_of( "?" );
if( std::string::npos != nPos )
{
/* Get only URL */
pureUrl = rawUrl.substr( 0, nPos );
/* Get only key=value data part */
std::string dataPart = rawUrl.substr( nPos + 1 );
std::map<std::string,std::string> querystring;
char* data = const_cast<char *>(dataPart.c_str());
querystring = ParseKeyValuePair(data);
std::map<std::string, std::string>::iterator qspos;
for(qspos = querystring.begin(); qspos != querystring.end(); ++qspos)
{
rawKeyValuePairs[qspos->first] = urlencode(qspos->second);
}
}
if(rawData != "")
{
std::map<std::string,std::string> querystring;
char* data = const_cast<char *>(rawData.c_str());
querystring = ParseKeyValuePair(data);
std::map<std::string, std::string>::iterator qspos;
for(qspos = querystring.begin(); qspos != querystring.end(); ++qspos)
{
rawKeyValuePairs[qspos->first] = urlencode(qspos->second);
}
}
/* Build key-value pairs needed for OAuth request token, without signature */
buildOAuthTokenKeyValuePairs( includeOAuthVerifierPin, "", std::string( "" ), rawKeyValuePairs );
/* Get url encoded base64 signature using request type, url and parameters */
getSignature( eType, pureUrl, rawKeyValuePairs, oauthSignature );
/* Now, again build key-value pairs with signature this time */
buildOAuthTokenKeyValuePairs( includeOAuthVerifierPin, std::string( "" ), oauthSignature, rawKeyValuePairs );
/* Get OAuth header in string format */
paramsSeperator = ",";
getStringFromOAuthKeyValuePairs( rawKeyValuePairs, rawParams, paramsSeperator );
/* Build authorization header */
oAuthHttpHeader.assign( oAuthLibDefaults::OAUTHLIB_AUTHHEADER_STRING.c_str() );
oAuthHttpHeader.append( rawParams.c_str() );
return ( oAuthHttpHeader.length() > 0 ) ? true : false;
}
std::map<std::string,std::string> oAuth::ParseKeyValuePair(char * data)
{
std::map<std::string,std::string> valuemap;
std::string tmpkey, tmpvalue;
std::string *tmpstr = &tmpkey;
register char* raw_get = data;
if (raw_get==NULL) {
valuemap.clear();
return valuemap;
}
while (*raw_get != '\0') {
if (*raw_get=='&') {
if (tmpkey!="") {
valuemap[UrlDecode(tmpkey)] = UrlDecode(tmpvalue);
}
tmpkey.clear();
tmpvalue.clear();
tmpstr = &tmpkey;
} else if (*raw_get=='=') {
tmpstr = &tmpvalue;
} else {
(*tmpstr) += (*raw_get);
}
raw_get++;
}
//enter the last pair to the map
if (tmpkey!="") {
valuemap[UrlDecode(tmpkey)] = UrlDecode(tmpvalue);
tmpkey.clear();
tmpvalue.clear();
}
return valuemap;
}
Original issue reported on code.google.com by [email protected]
on 20 Dec 2010 at 2:57
What steps will reproduce the problem?
eg:
1. twitterObj.setTwitterUsername(username);
2. twitterObj.setTwitterPassword(password);
3. twitterObj.getOAuth().setConsumerKey(consumer_key);
4. twitterObj.getOAuth().setConsumerSecret(consumer_secret);
then twitterObj.oAuthRequestToken(authurl) returns true and authurl
is empty. The problem seems from twitter side since it used to work before.
Something changed in the way oAuth PIN works ? Maybe they disabled
authenticating with pins ? I wasn't following their news lately
What is the expected output? What do you see instead?
Expected getting a url to get a pin for access token*, I see an empty url and
oAuthRequestToken returns true
What version of the product are you using? On what operating system?
Latest just pulled the svn
Original issue reported on code.google.com by [email protected]
on 21 Feb 2013 at 9:33
In twitCurl::oAuthHandlePIN there are several places where string::find is
called on oAuthLibDefaults. The result of string::find is not checked and
assumed to be valid (the string was found). However if an incorrect
username/password is supplied the returned data from twitter is html, and the
expected finds do not work. By not checking the return vaules of find the
result is a large buffer overrun in CHMAC_SHA1::AppendBuf2 (or was it
AppendBuff1 - can't recall now), resulting in exception.
The fix is of course to check the results of the find calls as below...
bool twitCurl::oAuthHandlePIN( const std::string& authorizeUrl /* in */ )
{
std::string dataStr;
std::string oAuthHttpHeader;
std::string authenticityTokenVal;
std::string oauthTokenVal;
std::string pinCodeVal;
unsigned long httpStatusCode = 0;
size_t nPosStart, nPosEnd;
struct curl_slist* pOAuthHeaderList = NULL;
/* Prepare standard params */
prepareStandardParams();
/* Set OAuth header */
m_oAuth.getOAuthHeader( eOAuthHttpGet, authorizeUrl, dataStr, oAuthHttpHeader );
if( oAuthHttpHeader.length() )
{
pOAuthHeaderList = curl_slist_append( pOAuthHeaderList, oAuthHttpHeader.c_str() );
if( pOAuthHeaderList )
{
curl_easy_setopt( m_curlHandle, CURLOPT_HTTPHEADER, pOAuthHeaderList );
}
}
/* Set http request and url */
curl_easy_setopt( m_curlHandle, CURLOPT_HTTPGET, 1 );
curl_easy_setopt( m_curlHandle, CURLOPT_URL, authorizeUrl.c_str() );
/* Send http request */
if( CURLE_OK == curl_easy_perform( m_curlHandle ) )
{
if( pOAuthHeaderList )
{
curl_easy_getinfo( m_curlHandle, CURLINFO_HTTP_CODE, &httpStatusCode );
// Now, let's find the authenticity token and oauth token
nPosStart = m_callbackData.find( oAuthLibDefaults::OAUTHLIB_AUTHENTICITY_TOKEN_TWITTER_RESP_KEY );
if (nPosStart != (size_t)-1)
{
nPosStart += oAuthLibDefaults::OAUTHLIB_AUTHENTICITY_TOKEN_TWITTER_RESP_KEY.length();
nPosEnd = m_callbackData.substr( nPosStart ).find( oAuthLibDefaults::OAUTHLIB_TOKEN_END_TAG_TWITTER_RESP );
if (nPosEnd != (size_t)-1)
{
authenticityTokenVal = m_callbackData.substr( nPosStart, nPosEnd );
nPosStart = m_callbackData.find( oAuthLibDefaults::OAUTHLIB_TOKEN_TWITTER_RESP_KEY );
if (nPosStart != (size_t)-1)
{
nPosStart += oAuthLibDefaults::OAUTHLIB_TOKEN_TWITTER_RESP_KEY.length();
nPosEnd = m_callbackData.substr( nPosStart ).find( oAuthLibDefaults::OAUTHLIB_TOKEN_END_TAG_TWITTER_RESP );
if (nPosEnd != (size_t)-1)
oauthTokenVal = m_callbackData.substr( nPosStart, nPosEnd );
else
{
curl_slist_free_all( pOAuthHeaderList );
return false;
}
}
}
else
{
curl_slist_free_all( pOAuthHeaderList );
return false;
}
}
else
{
curl_slist_free_all( pOAuthHeaderList );
return false;
}
curl_slist_free_all( pOAuthHeaderList );
}
}
else if( pOAuthHeaderList )
{
curl_slist_free_all( pOAuthHeaderList );
return false;
}
// Second phase for the authorization
pOAuthHeaderList = NULL;
oAuthHttpHeader.clear();
/* Prepare standard params */
prepareStandardParams();
/*
Now, we need to make a data string for POST operation
which includes oauth token, authenticity token, username, password.
*/
dataStr = oAuthLibDefaults::OAUTHLIB_TOKEN_KEY + "=" + oauthTokenVal + "&" + \
oAuthLibDefaults::OAUTHLIB_AUTHENTICITY_TOKEN_KEY + "=" + authenticityTokenVal + "&" + \
oAuthLibDefaults::OAUTHLIB_SESSIONUSERNAME_KEY + "=" + getTwitterUsername() + "&" + \
oAuthLibDefaults::OAUTHLIB_SESSIONPASSWORD_KEY + "=" + getTwitterPassword();
/* Set OAuth header */
m_oAuth.getOAuthHeader( eOAuthHttpPost, authorizeUrl, dataStr, oAuthHttpHeader );
if( oAuthHttpHeader.length() )
{
pOAuthHeaderList = curl_slist_append( pOAuthHeaderList, oAuthHttpHeader.c_str() );
if( pOAuthHeaderList )
{
curl_easy_setopt( m_curlHandle, CURLOPT_HTTPHEADER, pOAuthHeaderList );
}
}
/* Set http request and url */
curl_easy_setopt( m_curlHandle, CURLOPT_POST, 1 );
curl_easy_setopt( m_curlHandle, CURLOPT_URL, authorizeUrl.c_str() );
curl_easy_setopt( m_curlHandle, CURLOPT_COPYPOSTFIELDS, dataStr.c_str() );
/* Send http request */
if( CURLE_OK == curl_easy_perform( m_curlHandle ) )
{
if( pOAuthHeaderList )
{
curl_easy_getinfo( m_curlHandle, CURLINFO_HTTP_CODE, &httpStatusCode );
// Now, let's find the PIN CODE
nPosStart = m_callbackData.find( oAuthLibDefaults::OAUTHLIB_PIN_TWITTER_RESP_KEY );
if (nPosStart != (size_t)-1)
{
nPosStart += oAuthLibDefaults::OAUTHLIB_PIN_TWITTER_RESP_KEY.length();
nPosEnd = m_callbackData.substr( nPosStart ).find( oAuthLibDefaults::OAUTHLIB_PIN_END_TAG_TWITTER_RESP );
if (nPosEnd != (size_t)-1)
{
pinCodeVal = m_callbackData.substr( nPosStart, nPosEnd );
getOAuth().setOAuthPin( pinCodeVal );
curl_slist_free_all( pOAuthHeaderList );
return true;
}
else
{
curl_slist_free_all( pOAuthHeaderList );
return false;
}
}
else
{
curl_slist_free_all( pOAuthHeaderList );
return false;
}
}
}
else if( pOAuthHeaderList )
curl_slist_free_all( pOAuthHeaderList );
return false;
}
Original issue reported on code.google.com by [email protected]
on 13 Feb 2012 at 12:54
No Makefile exists for the latest version of twitCurl. I would like to use
twitCurl on linux with OAuth support, but there is no Makefile available.
Original issue reported on code.google.com by [email protected]
on 29 Oct 2010 at 4:52
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.