Files
@ 81a71207d534
Branch filter:
Location: libtransport.git/backends/twitter/Requests/TimelineRequest.cpp - annotation
81a71207d534
870 B
text/x-c++hdr
Improved user command parsing
f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 a2b385e88f06 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 a2b385e88f06 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 a2b385e88f06 f87f8cc356a1 f87f8cc356a1 f87f8cc356a1 | #include "TimelineRequest.h"
DEFINE_LOGGER(logger, "TimelineRequest")
void TimelineRequest::run()
{
replyMsg = "";
if( twitObj->timelineHomeGet() ) {
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";
}
}
}
void TimelineRequest::finalize()
{
if(replyMsg.length()) {
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 );
}
}
|