summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-11-03 13:43:00 +0000
committerRobert Pösel <robyer@seznam.cz>2012-11-03 13:43:00 +0000
commit719b9593a4644eac3284699192dd695205856f0c (patch)
treea364024d28231e18f192930129977c7eab7f4534 /protocols
parentf300387a7a7cb386465998fb39bc41c6f61c7dcd (diff)
Facebook: Fixed searching.
git-svn-id: http://svn.miranda-ng.org/main/trunk@2161 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/FacebookRM/src/process.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index f5d04fc343..19231a4451 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -744,40 +744,31 @@ void FacebookProto::SearchAckThread(void *targ)
if (!ssid.empty())
get_data += "&ssid=" + ssid;
- // Get notifications
http::response resp = facy.flap( FACEBOOK_REQUEST_SEARCH, NULL, &get_data );
// Process result data
- facy.validate_response(&resp);
+ facy.validate_response(&resp);
if (resp.code == HTTP_CODE_OK)
{
- std::string items = utils::text::source_get_value(&resp.data, 3, "<body", "<div class=\"c\">", "</body>");
+ std::string items = utils::text::source_get_value(&resp.data, 2, "<body", "</body>");
std::string::size_type pos = 0;
std::string::size_type pos2 = 0;
bool last = false;
- while (!last) {
- std::string item;
- if ((pos2 = items.find("<div class=\"c\">", pos)) != std::string::npos) {
- item = items.substr(pos, pos2 - pos);
- pos = pos2 + 14;
- } else {
- item = items.substr(pos);
- last = true;
- }
-
- count++;
+ while ((pos = items.find("<td class=\"pic\">", pos)) != std::string::npos) {
+ std::string item = items.substr(pos, items.find("</tr>", pos) - pos);
+ pos++; count++;
std::string id = utils::text::source_get_value2(&item, "?id=", "&\"");
if (id.empty())
id = utils::text::source_get_value2(&item, "?slog=", "&\"");
- std::string name = utils::text::source_get_value(&item, 2, "<span>", "</span>");
+ std::string name = utils::text::source_get_value(&item, 4, "<td class=\"name\">", "<a", ">", "</");
std::string surname;
std::string nick;
- std::string common = utils::text::source_get_value(&item, 2, "<span class=\"fcg\">", "</span>");
+ std::string common = utils::text::source_get_value(&item, 2, "<span class=\"mfss fcg\">", "</span>");
if ((pos2 = name.find(" <span class=\"alternate_name\">")) != std::string::npos) {
nick = name.substr(pos2 + 31, name.length() - pos2 - 32); // also remove brackets around nickname