Changeset - 1815ef0c749f
[Not reviewed]
0 1 0
Sarang Bharadwaj - 13 years ago 2012-06-08 21:00:39
sarang.bh@gmail.com
Solved the problem with #friends
1 file changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
backends/twitter/libtwitcurl/twitcurl.cpp
Show inline comments
 
@@ -626,36 +626,37 @@ bool twitCurl::userGet( std::string& userInfo, bool isUserId )
 
* @input: userInfo - vector of screen names or user ids
 
*         isUserId - true if userInfo contains an id
 
*
 
* @output: true if POST is success, otherwise false. This does not check http
 
*          response by twitter. Use getLastWebResponse() for that.
 
*
 
*--*/
 
bool twitCurl::userLookup( std::vector<std::string> &userInfo, bool isUserId )
 
{
 
    bool retVal = false;
 
    if( userInfo.size() )
 
    {
 
		std::string userIds = isUserId?twitCurlDefaults::TWITCURL_USERID : twitCurlDefaults::TWITCURL_SCREENNAME;
 
		std::string userIds = "";
 
		std::string sep = "";
 
		for(int i=0 ; i<std::min(100U,(unsigned int) userInfo.size()) ; i++, sep = ",")
 
			userIds += sep + userInfo[i];
 
 
        /* Set URL */
 
        std::string buildUrl = twitterDefaults::TWITCURL_LOOKUPUSERS_URL + twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType];
 
		userIds = (isUserId?twitCurlDefaults::TWITCURL_USERID : twitCurlDefaults::TWITCURL_SCREENNAME) + urlencode(userIds);
 
		
 
		std::string buildUrl = twitterDefaults::TWITCURL_LOOKUPUSERS_URL + twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType];
 
 
		std::cerr << buildUrl << " " << userIds << std::endl;
 
        
 
		/* Perform POST */
 
        retVal = performPost( buildUrl, userIds );
 
        retVal = performPost( buildUrl, userIds);
 
    }
 
    return retVal;
 
}
 
 
/*++
 
* @method: twitCurl::friendsGet
 
*
 
* @description: method to get a user's friends
 
*
 
* @input: userInfo - screen name or user id in string format,
 
*         isUserId - true if userInfo contains an id
 
*
0 comments (0 inline, 0 general)