Changeset - f1c11320c7d7
[Not reviewed]
0 3 0
Sarang Bharadwaj - 13 years ago 2012-05-29 16:08:29
sarang.bh@gmail.com
User timeline
3 files changed with 21 insertions and 1 deletions:
0 comments (0 inline, 0 general)
backends/twitter/libtwitcurl/twitcurl.cpp
Show inline comments
 
@@ -421,12 +421,30 @@ 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()
 
{
 
    /* Perform GET */
 
    return performGet( twitterDefaults::TWITCURL_HOME_TIMELINE_URL +
 
                       twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType] );
 
}
 
 
/*++
 
* @method: twitCurl::featuredUsersGet
 
*
 
* @description: method to get featured users
 
*
 
* @input: none
backends/twitter/libtwitcurl/twitcurl.h
Show inline comments
 
@@ -143,12 +143,13 @@ public:
 
    /* 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 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 */ );
 
backends/twitter/main.cpp
Show inline comments
 
@@ -9,12 +9,13 @@
 
#include "unistd.h"
 
#include "signal.h"
 
#include "sys/wait.h"
 
#include "sys/signal.h"
 
#include <boost/algorithm/string.hpp>
 
#include "twitcurl.h"
 
#include "Swiften/Parser/StringTreeParser.h"
 

	
 
#include <iostream>
 
#include <sstream>
 
#include <map>
 
#include <vector>
 
#include <cstdio>
 
@@ -225,13 +226,13 @@ class TwitterPlugin : public NetworkPlugin {
 
					if(connectionState[user] != CONNECTED) {
 
						LOG4CXX_ERROR(logger, "Trying to update status for " << user << " when not connected!");
 
						return;
 
					}
 
					
 
					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);
 
					} else {
 
						sessions[user]->getLastCurlError( replyMsg );
 
						LOG4CXX_INFO(logger, "twitCurl::timeline error: " << replyMsg );
0 comments (0 inline, 0 general)