示例#1
0
void FetchFriends::run() 
{	
	replyMsg = ""; 

	success = twitObj->friendsIdsGet(twitObj->getTwitterUsername());
	if(!success) return;	

	twitObj->getLastWebResponse( replyMsg );
	std::vector<std::string> IDs = getIDs( replyMsg );
	
	success = twitObj->userLookup(IDs, true);
	if(!success) return;

	twitObj->getLastWebResponse( replyMsg );
	friends = getUsers( replyMsg );

	HTTPRequest req;
	req.init();
	req.setProxy(twitObj->getProxyServerIp(), twitObj->getProxyServerPort(), twitObj->getProxyUserName(), twitObj->getProxyPassword());
	
	for(int i=0 ; i<friends.size() ; i++) {
		std::string img;
		friendAvatars.push_back("");
		if(req.GET(friends[i].getProfileImgURL(), img)) friendAvatars[i] = img;
		else {
			LOG4CXX_INFO(logger, "Warning: Couldn't fetch Profile Image for " << user << "'s friend " << friends[i].getScreenName())
		}
	}
}
示例#2
0
void ProfileImageRequest::run()
{
	HTTPRequest req;
	req.init();
	req.setProxy(ip, port, puser, ppasswd);
	success = req.GET(url, callbackdata);
	if(!success) error.assign(req.getCurlError());
}