Beispiel #1
0
string getUVALineFromFile(char *filename) {
    string res="",ts;
    FILE * fp=fopen(filename,"r");
    while (fgets(tmps,1000000,fp)) {
        res=tmps;
        if (res.find("<input type=\"hidden\" ")==0) {
            while (fgets(tmps,1000000,fp)) {
                ts=tmps;
                if (ts.find("<input type=\"hidden\" ")==string::npos) break;
                res=res+ts;
            }
            break;
        }
    }
    fclose(fp);
    int loc=0,tp;
    // cout<<res;
    string rres="";
    while ((loc=res.find("name=\"",loc))!=string::npos) {
        loc=loc+strlen("name=\"");
        tp=res.find("\"",loc);
        //cout <<loc <<" " << tp <<" "<<res.substr(loc,tp-loc)<<endl;
        rres=rres+escapeURL(res.substr(loc,tp-loc));
        loc=res.find("value=\"",tp);
        loc=loc+strlen("value=\"");
        tp=res.find("\"",loc);
        //cout <<loc <<" " << tp <<" "<<res.substr(loc,tp-loc)<<endl;
        rres=rres+"="+escapeURL(res.substr(loc,tp-loc))+"&";
    }
    return rres;
}
Beispiel #2
0
string getFirstFromFile(char *filename) {
    string res=getAllFromFile(filename);
    int loc=res.find("<tr class=\"sectiontableentry1\">");
    loc+=strlen("<tr class=\"sectiontableentry1\">");
    int loc2=res.find("</tr>",loc);
    //cout<<res.substr(loc,loc2-loc)<<endl<<"===="<<endl;
    return res.substr(loc,loc2-loc);
}
Beispiel #3
0
string getResFromFile(char *filename) {
    string res=getAllFromFile(filename);
    int st=res.find("<td style=\"text-align: center;\">");
    int pos=res.find("</tr>",st);
    return res.substr(st,pos-st);
}
Beispiel #4
0
string getResFromFile(char *filename) {
    string res=getAllFromFile(filename);
    int st=res.find("<tr onmouseover=");
    int pos=res.find("</tr>",st);
    return res.substr(st,pos-st);
}