I am working on a simple facebook messenger client (without the need of a developer account) and so far what i have achieved is getting all my messages - name, preview, time. What i'd like to find is the users href link
so far i have this:
MatchCollection name = Regex.Matches(
htmlText, "<div class=\"_l2\">(.*?)</div>");
MatchCollection preview = Regex.Matches(
htmlText, "<div class=\"_l3 fsm fwn fcg\">(.*?)</div>");
MatchCollection time = Regex.Matches(
htmlText, "<div class=\"_l4\">(.*?)</div>");
which fully works.
but i've tried a few things that i found on this website but nothing seemed to work. The href goes like: <a class="_k_ hoverZoomLink" rel="ignore" href="
and ends with a ". Could someone refer me to an article that actually might help me know how i can get that href. Or even a better way of doing it other than regex but i would really prefer regex:
for (int i = 0; i < name.Count; i++)
{
String resultName = Regex.Replace(name[i].Value, @"<[^>]*>", String.Empty);
String newName = resultName.Substring(0, resultName.Length - 5);
String resultPreview = Regex.Replace(preview[i].Value, @"<[^>]*>", String.Empty);
String s = time[i].Value;
int start = s.IndexOf("data-utime=\"") + 28;
int end = s.IndexOf("</abbr>", start);
String newTime = s.Substring(start, (end - start));
threads.Add(new Thread(newName, resultPreview, newTime, ""));
}
Thanks in advanced.