Changeset - f0b99d6b02b8
[Not reviewed]
Merge
0 37 5
Vitaly Takmazov - 13 years ago 2012-12-10 14:26:15
vitalyster@gmail.com
Merge branch 'retweeted_status'
2 files changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
backends/twitter/TwitterResponseParser.cpp
Show inline comments
 
@@ -54,12 +54,15 @@ EmbeddedStatus getEmbeddedStatus(const Swift::ParserElement::ref &element, const
 
	status.setReplyToStatusID( std::string( element->getChild(TwitterReponseTypes::in_reply_to_status_id, xmlns)->getText() ) );
 
	status.setReplyToUserID( std::string( element->getChild(TwitterReponseTypes::in_reply_to_user_id, xmlns)->getText() ) );
 
	status.setReplyToScreenName( std::string( element->getChild(TwitterReponseTypes::in_reply_to_screen_name, xmlns)->getText() ) );
 
	status.setRetweetCount( atoi( element->getChild(TwitterReponseTypes::retweet_count, xmlns)->getText().c_str() ) );
 
	status.setFavorited( std::string( element->getChild(TwitterReponseTypes::favorited, xmlns)->getText() )=="true" );
 
	status.setRetweeted( std::string( element->getChild(TwitterReponseTypes::retweeted, xmlns)->getText() )=="true" );
 
	if (status.isRetweeted()) {
 
		status.setTweet( std::string( element->getChild(TwitterReponseTypes::retweeted_status, xmlns)->getText() ) );
 
	}
 
	return status;
 
}
 

	
 
User getUser(const Swift::ParserElement::ref &element, const std::string xmlns) 
 
{
 
	User user;
 
@@ -96,12 +99,15 @@ Status getStatus(const Swift::ParserElement::ref &element, const std::string xml
 
	status.setReplyToUserID( std::string( element->getChild(TwitterReponseTypes::in_reply_to_user_id, xmlns)->getText() ) );
 
	status.setReplyToScreenName( std::string( element->getChild(TwitterReponseTypes::in_reply_to_screen_name, xmlns)->getText() ) );
 
	status.setUserData( getUser(element->getChild(TwitterReponseTypes::user, xmlns), xmlns) );
 
	status.setRetweetCount( atoi( element->getChild(TwitterReponseTypes::retweet_count, xmlns)->getText().c_str() ) );
 
	status.setFavorited( std::string( element->getChild(TwitterReponseTypes::favorited, xmlns)->getText() )=="true" );
 
	status.setRetweeted( std::string( element->getChild(TwitterReponseTypes::retweeted, xmlns)->getText() )=="true" );
 
	if (status.isRetweeted()) {
 
		status.setTweet( std::string( element->getChild(TwitterReponseTypes::retweeted_status, xmlns)->getText() ) );
 
	}
 
	return status;
 
}
 

	
 
DirectMessage getDirectMessage(const Swift::ParserElement::ref &element, const std::string xmlns) 
 
{
 
	DirectMessage DM;
backends/twitter/TwitterResponseParser.h
Show inline comments
 
@@ -17,12 +17,13 @@ namespace TwitterReponseTypes
 
	const std::string text = "text";
 
	const std::string truncated = "truncated";
 
	const std::string in_reply_to_status_id = "in_reply_to_user_id";
 
	const std::string in_reply_to_user_id = "in_reply_to_user_id";
 
	const std::string in_reply_to_screen_name = "in_reply_to_screen_name";
 
	const std::string retweet_count = "retweet_count";
 
	const std::string retweeted_status = "retweeted_status";
 
	const std::string favorited = "favorited";
 
	const std::string retweeted = "retweeted";
 
	const std::string user = "user";
 
	const std::string users = "users";
 
	const std::string status = "status";
 
	const std::string error = "error";
0 comments (0 inline, 0 general)