Changeset - 728517cf2312
[Not reviewed]
0 6 0
Sarang Bharadwaj - 13 years ago 2012-06-06 22:07:01
sarang.bh@gmail.com
Polling user's hometimline to get tweet updates; Need to fix #friends
6 files changed with 51 insertions and 17 deletions:
0 comments (0 inline, 0 general)
backends/twitter/Requests/TimelineRequest.cpp
Show inline comments
 
#include "TimelineRequest.h"
 
DEFINE_LOGGER(logger, "TimelineRequest")
 
void TimelineRequest::run()
 
{	
 
	
 
	bool success;
 
	
 
		
 
	if(userRequested != "") success = twitObj->timelineUserGet(false, false, 20, userRequested, false);
 
	else success = twitObj->timelineHomeGet();
 
	else success = twitObj->timelineHomeGet(since_id);
 
	
 
	replyMsg = ""; 
 
	if(success) {	
 
		LOG4CXX_INFO(logger, "Sending timeline request for user " << user)
 

	
 
		while(replyMsg.length() == 0) {
 
			twitObj->getLastWebResponse( replyMsg );
 
		}
 

	
 
		LOG4CXX_INFO(logger, user << " - " << replyMsg.length() << " " << replyMsg << "\n" );
 
		
 
		std::vector<Status> tweets = getTimeline(replyMsg);
 
		timeline = "\n";
 
		for(int i=0 ; i<tweets.size() ; i++) {
 
			timeline += tweets[i].getTweet() + "\n";
 

	
 
		if(tweets.size() && (since_id == "" || 
 
							 (since_id != "" && tweets[0].getID() != np->getMostRecentTweetID(user)) )) {
 
			for(int i=0 ; i<tweets.size() ; i++) {
 
				timeline += tweets[i].getTweet() + "\n";
 
			}
 
			np->updateUsersLastTweetID(user, tweets[0].getID());
 
		}
 
	}
 
}
 

	
 
void TimelineRequest::finalize()
 
{
 
	if(replyMsg.length()) {
 
	if(success && timeline != "\n") {
 
		std::string error = getErrorMessage(replyMsg);
 
		if(error.length()) {
 
			np->handleMessage(user, "twitter-account", error);
 
			LOG4CXX_INFO(logger, user << ": " << error);
 
		} else {	
 
			LOG4CXX_INFO(logger, user << "'s timeline\n" << replyMsg);
 
			np->handleMessage(user, "twitter-account", timeline); //send timeline
 
		}
 
	}
 
	else {
 
		twitObj->getLastCurlError( replyMsg );
 
		LOG4CXX_ERROR(logger, user << " - " << replyMsg );
 
	}
 
}
backends/twitter/Requests/TimelineRequest.h
Show inline comments
 
#ifndef TIMELINE_H
 
#define TIMELINE_H
 

	
 
#include "../ThreadPool.h"
 
#include "../libtwitcurl/twitcurl.h"
 
#include "../TwitterResponseParser.h"
 
#include "transport/networkplugin.h"
 
#include "../TwitterPlugin.h"
 
#include "transport/logging.h"
 
#include <string>
 
#include <iostream>
 

	
 
using namespace Transport;
 

	
 
class TimelineRequest : public Thread
 
{
 
	twitCurl *twitObj;
 
	std::string user;
 
	std::string userRequested;
 
	std::string replyMsg;
 
	std::string timeline;
 
	NetworkPlugin *np;
 
	std::string since_id;
 
	TwitterPlugin *np;
 
	bool success;
 

	
 
	public:
 
	TimelineRequest(NetworkPlugin *_np, twitCurl *obj, const std::string &_user, const std::string &_user2) {
 
	TimelineRequest(TwitterPlugin *_np, twitCurl *obj, const std::string &_user, const std::string &_user2, const std::string &_since_id) {
 
		twitObj = obj->clone();
 
		np = _np;
 
		user = _user;
 
		userRequested = _user2;
 
		since_id = _since_id;
 
	}
 

	
 
	~TimelineRequest() {
 
		//std::cerr << "*****Timeline request: DESTROYING twitObj****" << std::endl;
 
		delete twitObj;
 
	}
 

	
 
	void run();
 
	void finalize();
 
};
 
#endif
backends/twitter/TwitterPlugin.cpp
Show inline comments
 
@@ -63,178 +63,195 @@ void TwitterPlugin::_handleDataRead(boost::shared_ptr<Swift::SafeByteArray> data
 

	
 
// User trying to login into his twitter account
 
void TwitterPlugin::handleLoginRequest(const std::string &user, const std::string &legacyName, const std::string &password) 
 
{
 
	if(connectionState.count(user) && (connectionState[user] == NEW || 
 
										connectionState[user] == CONNECTED || 
 
										connectionState[user] == WAITING_FOR_PIN)) {
 
		LOG4CXX_INFO(logger, std::string("A session corresponding to ") + user + std::string(" is already active"))
 
		return;
 
	}
 
	
 
	LOG4CXX_INFO(logger, std::string("Received login request for ") + user)
 
	
 
	initUserSession(user, password);
 
	
 
	handleConnected(user);
 
	handleBuddyChanged(user, "twitter-account", "twitter", std::vector<std::string>(), pbnetwork::STATUS_ONLINE);
 
	
 
	LOG4CXX_INFO(logger, "Querying database for usersettings of " << user)
 
	
 
	std::string key, secret;
 
	getUserOAuthKeyAndSecret(user, key, secret);
 

	
 
	if(key == "" || secret == "") {			
 
		LOG4CXX_INFO(logger, "Intiating OAuth Flow for user " << user)
 
		tp->runAsThread(new OAuthFlow(np, sessions[user], user, sessions[user]->getTwitterUsername()));
 
	} else {
 
		LOG4CXX_INFO(logger, user << " is already registerd. Using the stored oauth key and secret")
 
		LOG4CXX_INFO(logger, key << " " << secret)	
 
		pinExchangeComplete(user, key, secret);
 
	}
 
}
 

	
 
// User logging out
 
void TwitterPlugin::handleLogoutRequest(const std::string &user, const std::string &legacyName) 
 
{
 
	delete sessions[user];
 
	sessions[user] = NULL;
 
	connectionState[user] = DISCONNECTED;
 
	onlineUsers.erase(user);
 
}
 

	
 

	
 
void TwitterPlugin::handleMessageSendRequest(const std::string &user, const std::string &legacyName, const std::string &message, const std::string &xhtml) 
 
{
 
	
 
	if(legacyName == "twitter-account") {
 

	
 
		char ch;
 
		std::string cmd = "", data = "";
 
		std::istringstream in(message.c_str());
 
		in >> cmd >> data;
 
	 	
 
		int i;
 
		for(i=0 ; i<message.size() && message[i] != ' '; i++) cmd += message[i];
 
		while(i<message.size() && message[i] == ' ') i++;
 
		data = message.substr(i);
 
		
 
		//handleMessage(user, "twitter-account", cmd + " " + data);
 

	
 
		if(cmd == "#pin") tp->runAsThread(new PINExchangeProcess(np, sessions[user], user, data));
 
		else if(cmd == "#help") tp->runAsThread(new HelpMessageRequest(np, user));
 
		else if(cmd[0] == '@') {
 
			std::string username = cmd.substr(1); 
 
			tp->runAsThread(new DirectMessageRequest(np, sessions[user], user, username, data));
 
		}
 
		else if(cmd == "#status") tp->runAsThread(new StatusUpdateRequest(np, sessions[user], user, data));
 
		else if(cmd == "#timeline") tp->runAsThread(new TimelineRequest(np, sessions[user], user, data));
 
		else if(cmd == "#timeline") tp->runAsThread(new TimelineRequest(np, sessions[user], user, data, ""));
 
		else if(cmd == "#friends") tp->runAsThread(new FetchFriends(np, sessions[user], user));
 
		else handleMessage(user, "twitter-account", "Unknown command! Type #help for a list of available commands.");
 
	}
 
}
 

	
 
void TwitterPlugin::handleBuddyUpdatedRequest(const std::string &user, const std::string &buddyName, const std::string &alias, const std::vector<std::string> &groups) 
 
{
 
	LOG4CXX_INFO(logger, user << ": Added buddy " << buddyName << ".");
 
	handleBuddyChanged(user, buddyName, alias, groups, pbnetwork::STATUS_ONLINE);
 
}
 

	
 
void TwitterPlugin::handleBuddyRemovedRequest(const std::string &user, const std::string &buddyName, const std::vector<std::string> &groups) 
 
{
 

	
 
}
 

	
 

	
 
void TwitterPlugin::pollForTweets()
 
{
 
	boost::mutex::scoped_lock lock(userlock);
 
	std::set<std::string>::iterator it = onlineUsers.begin();
 
	while(it != onlineUsers.end()) {
 
		std::string user = *it;
 
		tp->runAsThread(new TimelineRequest(np, sessions[user], user, ""));
 
		tp->runAsThread(new TimelineRequest(np, sessions[user], user, "", mostRecentTweetID[user]));
 
		it++;
 
	}
 
	m_timer->start();
 
}
 

	
 

	
 
bool TwitterPlugin::getUserOAuthKeyAndSecret(const std::string user, std::string &key, std::string &secret) 
 
{
 
	boost::mutex::scoped_lock lock(dblock);
 
	
 
	UserInfo info;
 
	if(storagebackend->getUser(user, info) == false) {
 
		LOG4CXX_ERROR(logger, "Didn't find entry for " << user << " in the database!")
 
		return false;
 
	}
 

	
 
	key="", secret=""; int type;
 
	storagebackend->getUserSetting((long)info.id, OAUTH_KEY, type, key);
 
	storagebackend->getUserSetting((long)info.id, OAUTH_SECRET, type, secret);
 
	return true;
 
}
 

	
 
bool TwitterPlugin::storeUserOAuthKeyAndSecret(const std::string user, const std::string OAuthKey, const std::string OAuthSecret) 
 
{
 

	
 
	boost::mutex::scoped_lock lock(dblock);
 

	
 
	UserInfo info;
 
	if(storagebackend->getUser(user, info) == false) {
 
		LOG4CXX_ERROR(logger, "Didn't find entry for " << user << " in the database!")
 
		return false;
 
	}
 

	
 
	storagebackend->updateUserSetting((long)info.id, OAUTH_KEY, OAuthKey);	
 
	storagebackend->updateUserSetting((long)info.id, OAUTH_SECRET, OAuthSecret);
 
	return true;
 
}
 

	
 
void TwitterPlugin::initUserSession(const std::string user, const std::string password)
 
{
 
	boost::mutex::scoped_lock lock(userlock);
 

	
 
	std::string username = user.substr(0,user.find('@'));
 
	std::string passwd = password;
 
	LOG4CXX_INFO(logger, username + "  " + passwd)
 

	
 
	sessions[user] = new twitCurl();	
 
	if(CONFIG_HAS_KEY(config,"proxy.server")) {			
 
		std::string ip = CONFIG_STRING(config,"proxy.server");
 

	
 
		std::ostringstream out; 
 
		out << CONFIG_INT(config,"proxy.port");
 
		std::string port = out.str();
 

	
 
		std::string puser = CONFIG_STRING(config,"proxy.user");
 
		std::string ppasswd = CONFIG_STRING(config,"proxy.password");
 

	
 
		LOG4CXX_INFO(logger, ip << " " << port << " " << puser << " " << ppasswd)
 
		
 
		if(ip != "localhost" && port != "0") {
 
			sessions[user]->setProxyServerIp(ip);
 
			sessions[user]->setProxyServerPort(port);
 
			sessions[user]->setProxyUserName(puser);
 
			sessions[user]->setProxyPassword(ppasswd);
 
		}
 
	}
 

	
 
	connectionState[user] = NEW;			
 
	sessions[user]->setTwitterUsername(username);
 
	sessions[user]->setTwitterPassword(passwd); 
 
	sessions[user]->getOAuth().setConsumerKey(consumerKey);
 
	sessions[user]->getOAuth().setConsumerSecret(consumerSecret);
 
}
 

	
 
void TwitterPlugin::OAuthFlowComplete(const std::string user, twitCurl *obj) 
 
{
 
	boost::mutex::scoped_lock lock(userlock);	
 

	
 
	delete sessions[user];
 
	sessions[user] = obj->clone();	
 
	connectionState[user] = WAITING_FOR_PIN;
 
}	
 

	
 
void TwitterPlugin::pinExchangeComplete(const std::string user, const std::string OAuthAccessTokenKey, const std::string OAuthAccessTokenSecret) 
 
{
 
	boost::mutex::scoped_lock lock(userlock);	
 
		
 
	sessions[user]->getOAuth().setOAuthTokenKey( OAuthAccessTokenKey );
 
	sessions[user]->getOAuth().setOAuthTokenSecret( OAuthAccessTokenSecret );
 
	connectionState[user] = CONNECTED;
 
	onlineUsers.insert(user);
 
	mostRecentTweetID[user] = "";
 
}	
 

	
 
void TwitterPlugin::updateUsersLastTweetID(const std::string user, const std::string ID)
 
{
 
	boost::mutex::scoped_lock lock(userlock);	
 
	mostRecentTweetID[user] = ID;
 
}
 

	
 
std::string TwitterPlugin::getMostRecentTweetID(const std::string user)
 
{
 
	boost::mutex::scoped_lock lock(userlock);	
 
	return mostRecentTweetID[user];
 
}
backends/twitter/TwitterPlugin.h
Show inline comments
 
@@ -38,68 +38,73 @@ using namespace boost::program_options;
 
using namespace Transport;
 

	
 

	
 
#define STR(x) (std::string("(") + x.from + ", " + x.to + ", " + x.message + ")")
 
class TwitterPlugin;
 
extern TwitterPlugin *np;
 
extern Swift::SimpleEventLoop *loop_; // Event Loop
 

	
 
class TwitterPlugin : public NetworkPlugin {
 
	public:
 
		Swift::BoostNetworkFactories *m_factories;
 
		Swift::BoostIOServiceThread m_boostIOServiceThread;
 
		boost::shared_ptr<Swift::Connection> m_conn;
 
		Swift::Timer::ref m_timer;
 
		StorageBackend *storagebackend;
 

	
 
		TwitterPlugin(Config *config, Swift::SimpleEventLoop *loop, StorageBackend *storagebackend, const std::string &host, int port);
 
		~TwitterPlugin();
 

	
 
		// Send data to NetworkPlugin server
 
		void sendData(const std::string &string);
 

	
 
		// Receive date from the NetworkPlugin server and invoke the appropirate payload handler (implement in the NetworkPlugin class)
 
		void _handleDataRead(boost::shared_ptr<Swift::SafeByteArray> data);
 
	
 
		// User trying to login into his twitter account
 
		void handleLoginRequest(const std::string &user, const std::string &legacyName, const std::string &password);
 
		
 
		// User logging out
 
		void handleLogoutRequest(const std::string &user, const std::string &legacyName);
 

	
 
		void handleMessageSendRequest(const std::string &user, const std::string &legacyName, const std::string &message, const std::string &xhtml = "");
 

	
 
		void handleBuddyUpdatedRequest(const std::string &user, const std::string &buddyName, const std::string &alias, const std::vector<std::string> &groups);
 

	
 
		void handleBuddyRemovedRequest(const std::string &user, const std::string &buddyName, const std::vector<std::string> &groups);
 
		
 
		void pollForTweets();
 
		
 
		bool getUserOAuthKeyAndSecret(const std::string user, std::string &key, std::string &secret);
 
		
 
		bool storeUserOAuthKeyAndSecret(const std::string user, const std::string OAuthKey, const std::string OAuthSecret);
 
		
 
		void initUserSession(const std::string user, const std::string password);
 
		
 
		void OAuthFlowComplete(const std::string user, twitCurl *obj);
 
		
 
		void pinExchangeComplete(const std::string user, const std::string OAuthAccessTokenKey, const std::string OAuthAccessTokenSecret);
 
		
 
		void updateUsersLastTweetID(const std::string user, const std::string ID);
 

	
 
		std::string getMostRecentTweetID(const std::string user);
 

	
 
	private:
 
		enum status {NEW, WAITING_FOR_PIN, CONNECTED, DISCONNECTED};
 
		
 
		Config *config;
 

	
 
		std::string consumerKey;
 
		std::string consumerSecret;
 
		std::string OAUTH_KEY;
 
		std::string OAUTH_SECRET;
 

	
 
		boost::mutex dblock, userlock;
 

	
 
		ThreadPool *tp;
 
		std::map<std::string, twitCurl*> sessions;		
 
		std::map<std::string, status> connectionState;
 
		std::map<std::string, std::string> mostRecentTweetID;
 
		std::set<std::string> onlineUsers;
 
};
 

	
 
#endif
backends/twitter/libtwitcurl/twitcurl.cpp
Show inline comments
 
@@ -419,101 +419,106 @@ bool twitCurl::statusShowById( std::string& statusId )
 
* @output: true if DELETE is success, otherwise false. This does not check http
 
*          response by twitter. Use getLastWebResponse() for that.
 
*
 
*--*/
 
bool twitCurl::statusDestroyById( std::string& statusId )
 
{
 
    bool retVal = false;
 
    if( statusId.length() )
 
    {
 
        /* Prepare URL */
 
        std::string buildUrl = twitterDefaults::TWITCURL_STATUDESTROY_URL + statusId +
 
                               twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType];
 
 
        /* Perform DELETE */
 
        retVal = performDelete( buildUrl );
 
    }
 
    return retVal;
 
}
 
 
/*++
 
* @method: twitCurl::timelinePublicGet
 
*
 
* @description: method to get public timeline
 
*
 
* @input: none
 
*
 
* @output: true if GET is success, otherwise false. This does not check http
 
*          response by twitter. Use getLastWebResponse() for that.
 
*
 
*--*/
 
bool twitCurl::timelinePublicGet()
 
{
 
    /* Perform GET */
 
    return performGet( twitterDefaults::TWITCURL_PUBLIC_TIMELINE_URL +
 
                       twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType] );
 
}
 
 
/*++
 
* @method: twitCurl::timelineHomeGet
 
*
 
* @description: method to get home timeline
 
*
 
* @input: none
 
*
 
* @output: true if GET is success, otherwise false. This does not check http
 
*          response by twitter. Use getLastWebResponse() for that.
 
*
 
*--*/
 
bool twitCurl::timelineHomeGet()
 
bool twitCurl::timelineHomeGet(std::string sinceId)
 
{
 
    std::string buildUrl = twitterDefaults::TWITCURL_HOME_TIMELINE_URL +
 
                           twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType];
 
    if( sinceId.length() )
 
    {
 
        buildUrl += twitCurlDefaults::TWITCURL_URL_SEP_QUES + twitCurlDefaults::TWITCURL_SINCEID + sinceId;
 
    }
 
    /* Perform GET */
 
    return performGet( twitterDefaults::TWITCURL_HOME_TIMELINE_URL +
 
                       twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType] );
 
    return performGet( buildUrl );
 
}
 
 
/*++
 
* @method: twitCurl::featuredUsersGet
 
*
 
* @description: method to get featured users
 
*
 
* @input: none
 
*
 
* @output: true if GET is success, otherwise false. This does not check http
 
*          response by twitter. Use getLastWebResponse() for that.
 
*
 
*--*/
 
bool twitCurl::featuredUsersGet()
 
{
 
    /* Perform GET */
 
    return performGet( twitterDefaults::TWITCURL_FEATURED_USERS_URL +
 
                       twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType] );
 
}
 
 
/*++
 
* @method: twitCurl::timelineFriendsGet
 
*
 
* @description: method to get friends timeline
 
*
 
* @input: none
 
*
 
* @output: true if GET is success, otherwise false. This does not check http
 
*          response by twitter. Use getLastWebResponse() for that.
 
*
 
*--*/
 
bool twitCurl::timelineFriendsGet()
 
{
 
    /* Perform GET */
 
    return performGet( twitterDefaults::TWITCURL_FRIENDS_TIMELINE_URL +
 
                       twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType] );
 
}
 
 
/*++
 
* @method: twitCurl::mentionsGet
 
*
 
* @description: method to get mentions
 
*
 
* @input: sinceId - String specifying since id parameter
 
*
 
* @output: true if GET is success, otherwise false. This does not check http
 
*          response by twitter. Use getLastWebResponse() for that.
 
*
backends/twitter/libtwitcurl/twitcurl.h
Show inline comments
 
@@ -104,97 +104,97 @@ namespace twitterDefaults
 
    const std::string TWITCURL_BLOCKSDESTROY_URL = "http://api.twitter.com/1/blocks/destroy/";
 
 
    /* Saved Search URLs */
 
    const std::string TWITCURL_SAVEDSEARCHGET_URL = "http://api.twitter.com/1/saved_searches";
 
    const std::string TWITCURL_SAVEDSEARCHSHOW_URL = "http://api.twitter.com/1/saved_searches/show/";
 
    const std::string TWITCURL_SAVEDSEARCHCREATE_URL = "http://api.twitter.com/1/saved_searches/create";
 
    const std::string TWITCURL_SAVEDSEARCHDESTROY_URL = "http://api.twitter.com/1/saved_searches/destroy/";
 
 
    /* Trends URLs */
 
    const std::string TWITCURL_TRENDS_URL = "http://api.twitter.com/1/trends";
 
    const std::string TWITCURL_TRENDSDAILY_URL = "http://api.twitter.com/1/trends/daily";
 
    const std::string TWITCURL_TRENDSCURRENT_URL = "http://api.twitter.com/1/trends/current";
 
    const std::string TWITCURL_TRENDSWEEKLY_URL = "http://api.twitter.com/1/trends/weekly";
 
    const std::string TWITCURL_TRENDSAVAILABLE_URL = "http://api.twitter.com/1/trends/available";
 
 
};
 
 
/* twitCurl class */
 
class twitCurl
 
{
 
public:
 
    twitCurl();
 
    ~twitCurl();
 
 
    /* Twitter OAuth authorization methods */
 
    oAuth& getOAuth();
 
    bool oAuthRequestToken( std::string& authorizeUrl /* out */ );
 
    bool oAuthAccessToken();
 
    bool oAuthHandlePIN( const std::string& authorizeUrl /* in */ );
 
 
    /* Twitter login APIs, set once and forget */
 
    std::string& getTwitterUsername();
 
    std::string& getTwitterPassword();
 
    void setTwitterUsername( std::string& userName /* in */ );
 
    void setTwitterPassword( std::string& passWord /* in */ );
 
 
    /* Twitter API type */
 
    void setTwitterApiType( twitCurlTypes::eTwitCurlApiFormatType eType );
 
 
    /* Twitter search APIs */
 
    bool search( std::string& searchQuery /* in */ );
 
 
    /* Twitter status APIs */
 
    bool statusUpdate( std::string& newStatus /* in */ );
 
    bool statusShowById( std::string& statusId /* in */ );
 
    bool statusDestroyById( std::string& statusId /* in */ );
 
 
    /* Twitter timeline APIs */
 
    bool timelineHomeGet();
 
    bool timelineHomeGet(std::string sinceId = ""  /* in */);
 
    bool timelinePublicGet();
 
    bool timelineFriendsGet();
 
    bool timelineUserGet( bool trimUser /* in */, bool includeRetweets /* in */, unsigned int tweetCount /* in */, std::string userInfo = "" /* in */, bool isUserId = false /* in */ );
 
    bool featuredUsersGet();
 
    bool mentionsGet( std::string sinceId = "" /* in */ );
 
 
    /* Twitter user APIs */
 
	bool userLookup( std::vector<std::string> &userInfo /* in */,  bool isUserId = false /* in */);
 
    bool userGet( std::string& userInfo /* in */, bool isUserId = false /* in */ );
 
    bool friendsGet( std::string userInfo = "" /* in */, bool isUserId = false /* in */ );
 
    bool followersGet( std::string userInfo = "" /* in */, bool isUserId = false /* in */ );
 
 
    /* Twitter direct message APIs */
 
    bool directMessageGet();
 
    bool directMessageSend( std::string& userInfo /* in */, std::string& dMsg /* in */, bool isUserId = false /* in */ );
 
    bool directMessageGetSent();
 
    bool directMessageDestroyById( std::string& dMsgId /* in */ );
 
 
    /* Twitter friendships APIs */
 
    bool friendshipCreate( std::string& userInfo /* in */, bool isUserId = false /* in */ );
 
    bool friendshipDestroy( std::string& userInfo /* in */, bool isUserId = false /* in */ );
 
    bool friendshipShow( std::string& userInfo /* in */, bool isUserId = false /* in */ );
 
 
    /* Twitter social graphs APIs */
 
    bool friendsIdsGet( std::string& userInfo /* in */, bool isUserId = false /* in */ );
 
    bool followersIdsGet( std::string& userInfo /* in */, bool isUserId = false /* in */ );
 
 
    /* Twitter account APIs */
 
    bool accountRateLimitGet();
 
 
    /* Twitter favorites APIs */
 
    bool favoriteGet();
 
    bool favoriteCreate( std::string& statusId /* in */ );
 
    bool favoriteDestroy( std::string& statusId /* in */ );
 
 
    /* Twitter block APIs */
 
    bool blockCreate( std::string& userInfo /* in */ );
 
    bool blockDestroy( std::string& userInfo /* in */ );
 
 
    /* Twitter search APIs */
 
    bool savedSearchGet();
 
    bool savedSearchCreate( std::string& query /* in */ );
 
    bool savedSearchShow( std::string& searchId /* in */ );
 
    bool savedSearchDestroy( std::string& searchId /* in */ );
 
 
    /* Twitter trends APIs (JSON) */
 
    bool trendsGet();
 
    bool trendsDailyGet();
0 comments (0 inline, 0 general)