diff --git a/backends/twitter/TwitterResponseParser.cpp b/backends/twitter/TwitterResponseParser.cpp index 1f8690a39b19ba8fb45c266a1a9164f0a7674dbb..2e403da6194177a46ccb29e1d06718faa499ad74 100644 --- a/backends/twitter/TwitterResponseParser.cpp +++ b/backends/twitter/TwitterResponseParser.cpp @@ -46,7 +46,7 @@ std::vector getTimeline(std::string &xml) Swift::ParserElement::ref rootElement = Swift::StringTreeParser::parse(xml); if(rootElement->getName() != "statuses") { - LOG4CXX_ERROR(logger, "XML doesnt correspond to timline") + LOG4CXX_ERROR(logger, "XML doesn't correspond to timeline") return statuses; } @@ -60,3 +60,22 @@ std::vector getTimeline(std::string &xml) } return statuses; } + +std::vector getIDs(std::string &xml) +{ + std::vector IDs; + Swift::ParserElement::ref rootElement = Swift::StringTreeParser::parse(xml); + + if(rootElement->getName() != TwitterReponseTypes::id_list) { + LOG4CXX_ERROR(logger, "XML doesn't correspond to id_list"); + return IDs; + } + + const std::string xmlns = rootElement->getNamespace(); + const std::vector ids = rootElement->getChild(TwitterReponseTypes::ids, xmlns)->getChildren(TwitterReponseTypes::id, xmlns); + + for(int i=0 ; igetText() )); + } + return IDs; +}