User timeline

This commit is contained in:
Sarang Bharadwaj 2012-05-29 19:38:29 +05:30
parent ab1a0140c2
commit f1c11320c7
3 changed files with 21 additions and 1 deletions

View file

@ -424,6 +424,24 @@ bool twitCurl::timelinePublicGet()
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()
{
/* Perform GET */
return performGet( twitterDefaults::TWITCURL_HOME_TIMELINE_URL +
twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType] );
}
/*++
* @method: twitCurl::featuredUsersGet
*

View file

@ -146,6 +146,7 @@ public:
bool statusDestroyById( std::string& statusId /* in */ );
/* Twitter timeline APIs */
bool timelineHomeGet();
bool timelinePublicGet();
bool timelineFriendsGet();
bool timelineUserGet( bool trimUser /* in */, bool includeRetweets /* in */, unsigned int tweetCount /* in */, std::string userInfo = "" /* in */, bool isUserId = false /* in */ );

View file

@ -12,6 +12,7 @@
#include "sys/signal.h"
#include <boost/algorithm/string.hpp>
#include "twitcurl.h"
#include "Swiften/Parser/StringTreeParser.h"
#include <iostream>
#include <sstream>
@ -228,7 +229,7 @@ class TwitterPlugin : public NetworkPlugin {
}
std::string replyMsg;
if( sessions[user]->timelinePublicGet() ) {
if( sessions[user]->timelinePublicGet()/*(false, false, 20, sessions[user]->getTwitterUsername(), true)*/ ) {
sessions[user]->getLastWebResponse( replyMsg );
LOG4CXX_INFO(logger, "twitCurl::timeline web response: " << replyMsg );
handleMessage(user, "twitter-account", replyMsg);