/*++ * @method: twitCurl::friendshipCreate * * @description: method to add a twitter user as friend (follow a user) * * @input: userInfo - user id or screen name of a user * isUserId - true if userInfo contains a user id instead of screen name * * @output: true if POST is success, otherwise false. This does not check http * response by twitter. Use getLastWebResponse() for that. * *--*/ bool twitCurl::friendshipCreate( std::string& userInfo, bool isUserId ) { bool retVal = false; if( isCurlInit() && userInfo.length() ) { /* Prepare URL */ std::string buildUrl( "" ); utilMakeUrlForUser( buildUrl, twitterDefaults::TWITCURL_FRIENDSHIPSCREATE_URL, userInfo, isUserId ); /* Send some dummy data in POST */ std::string dummyData( "" ); dummyData = twitCurlDefaults::TWITCURL_TEXTSTRING; dummyData.append( "dummy" ); /* Perform POST */ retVal = performPost( buildUrl, dummyData ); } return retVal; }
/*++ * @method: twitCurl::blockCreate * * @description: method to block a user * * @input: userInfo - user id or screen name * * @output: true if POST is success, otherwise false. This does not check http * response by twitter. Use getLastWebResponse() for that. * *--*/ bool twitCurl::blockCreate( std::string& userInfo ) { bool retVal = false; if( isCurlInit() ) { /* Prepare URL */ std::string buildUrl( "" ); buildUrl = twitterDefaults::TWITCURL_BLOCKSCREATE_URL; buildUrl.append( userInfo.c_str() ); buildUrl.append( twitCurlDefaults::TWITCURL_EXTENSIONFORMAT.c_str() ); /* Send some dummy data in POST */ std::string dummyData( "" ); dummyData = twitCurlDefaults::TWITCURL_TEXTSTRING; dummyData.append( "dummy" ); /* Perform POST */ retVal = performPost( buildUrl, dummyData ); } return retVal; }
/*++ * @method: twitCurl::favoriteCreate * * @description: method to favorite a status message * * @input: statusId - id in string format of the status to be favorited * * @output: true if POST is success, otherwise false. This does not check http * response by twitter. Use getLastWebResponse() for that. * *--*/ bool twitCurl::favoriteCreate( std::string& statusId ) { bool retVal = false; if( isCurlInit() ) { /* Prepare URL */ std::string buildUrl( "" ); buildUrl = twitterDefaults::TWITCURL_FAVORITECREATE_URL; buildUrl.append( statusId.c_str() ); buildUrl.append( twitCurlDefaults::TWITCURL_EXTENSIONFORMAT.c_str() ); /* Send some dummy data in POST */ std::string dummyData( "" ); dummyData = twitCurlDefaults::TWITCURL_TEXTSTRING; dummyData.append( "dummy" ); /* Perform POST */ retVal = performPost( buildUrl, dummyData ); } return retVal; }
InstrumentData::InstrumentData() { rawInput = dummyData(); }