for a project Im working on right now I need to make a Post grabber, it needs to get the contents of a post (with username etc) in HTML
so far I have this:
string[] Posts = new string[0];
string Start = "<div class=\"windowbg\">".ToLower();
for (int S = 0; S < page.Length - Start.Length; ++S)
{
string part = page.Substring(S, Start.Length).ToLower();
if (part==Start)
{
int A = 0;
for (int E = S; E < page.Length - 2; ++E)
{
part = page.Substring(E, 2);
if (part.StartsWith("<") & !part.EndsWith("/")) {++A; }
if (part == "</") { --A; }
if (part == "</" & A == 0)
{
Posts = AddToArray(page.Substring(S, E - S), Posts);
S = E;
break;
}
}
}
}
but is doesn't always give me the post or sometimes not enough