bool NDLocalXmlString::addKeyValue( const string& keyLine, const string& valLine ) { string strKey, strValue; if (getMidString( keyLine, "<key>", "</key>", strKey ) && getMidString( valLine, "<string>", "</string>", strValue )) { m_kMapData[ strKey ] = strValue; return true; } else { logErr( keyLine, valLine ); } return false; }
void MainWindow::registersis() { static QMutex regmutex; MyMutexLocker mml1(®mutex); if (!mml1.success()) return; QString loadresult ; // get time and place outputInfor("获取在线时间以及版面"); QString s = "http://174.127.195.200/bbs/space.php?action=viewpro&username="******"error") { return; } int a1,a2; QString time1 = getMidString(loadresult,0,"bold",">","<",&a1); QString time2 = getMidString(loadresult,a1,"bold",">","<",&a1); QString ttt = myTr("总计在线 ")+time1+myTr(" 小时, 本月在线 ")+time2+myTr(" 小时"); if (time1<0 || ttt.size()>100) { outputInfor(" 无法访问,可能原因:未登录 "); return; } outputInfor(ttt); a1 = loadresult.indexOf(myTr("版主")); a2 = loadresult.indexOf(myTr("勋章")); QString bbb; while(true) { QString b = getMidString(loadresult,a1,"html",">","<", &a1); if (a1<0 || a1 >a2) break; if (bbb!="") bbb+=","; bbb+= b; } outputInfor(bbb); QString mes ="ID:" + Util::username +"\n"; mes += myTr("日期:") +QDateTime::currentDateTime().date().toString("yyyy-MM-dd") +"\n"; mes += myTr("版区:") + bbb +"\n"; mes += myTr("在线时间:") + ttt +"\n"; if (NetworkUtil::sendreply(Util::regpage,mes,0,0,"",NetworkUtil::baseTimeout)) { outputInfor("签到成功"); } }
void MainWindow::fanye() { MyMutexLocker mml2("mainwindowfanye",1000); if (!mml2.success()) return; static int aaa = 0; while (true) { const char * ss[4] = {"4098214","4173362","4726825","4438133"}; for (int i=0; i<4; i++) { waitMillisec(500); QString sss0 = "http://174.127.195.200/bbs/thread-"; sss0+= ss[i]; sss0+= "-10000-1.html"; QUrl url(sss0); QString loadresult; while(loadresult.size()<100) loadresult= NetworkUtil:: sendquest(url); QString sss1 = getMidString(loadresult,0,"d","<em> "," </em>"); int total; total = sss1.toInt(); qDebug()<<total; outputInfor(QString::number(total)); if (total>100 && total % 10 ==0) { QString message = myTr("全自动翻页试用中 ") + QString::number(total+1); qDebug()<< "fanye " << ++aaa; while(! NetworkUtil:: sendreply(ss[i],message)) { QCoreApplication::processEvents(); } } } } }
void MainWindow::robfloor() { MyMutexLocker mml2("mainwindowrobfloor",1000); if (!mml2.success()) return; static int aaa = 0; while (true) { const char * ss[4] = {"4098214"}; waitMillisec(500); QString sss0 = "http://174.127.195.200/bbs/thread-"; sss0+= ss[0]; sss0+= "-10000-1.html"; QUrl url(sss0); QString loadresult; while(loadresult.size()<100) loadresult= NetworkUtil:: sendquest(url); QString sss1 = getMidString(loadresult,0,"d","<em> "," </em>"); int total; total = sss1.toInt(); qDebug()<<total; outputInfor(QString::number(total)); if (total >= 8886 ) { QString message = myTr("我要抢8888楼"); qDebug()<< "fanye " << ++aaa; NetworkUtil::mustSendreply(ss[0],"",message); message = myTr("8888楼是我的"); qDebug()<< "fanye " << ++aaa; NetworkUtil::mustSendreply(ss[0],"",message); return; } } }
void tongjitiezi() { // qiandao QString qiandaoTid = QInputDialog::getText(0,"","qian dao tid"); auto x2 = NetworkUtil::getPosterList(qiandaoTid,-1, qiandaoTid + "poster.txt"); qDebug()<<x2; QMap<QString, QMap<int, int> > mmsm; for (int i=0; i<x2.size(); i++) { auto x = x2[i].toObject(); auto author = x["author"].toString(); auto datetime = QDateTime::fromString(x["datetime"].toString(), "yyyy-M-d hh:mm"); mmsm[author][datetime.date().day()] ++ ; } QString ss; for (int i=0; i<=31; i++) { ss += "[td]" + QString::number(i) + "[/td]"; } ss += "[td]time[/td]"; ss = "[table=98%,white][tr=skyblue]" + ss + "[/tr]"; for (auto i = mmsm.begin(); i!= mmsm.end(); i++) { QString row; auto a = i.key(); auto b = *i; row += "[td]" + a + "[/td]"; for (int j=1; j<=31; j++) { int f = b[j]; if (f==0) row += "[td][color=red]" + QString::number(f) + "[/color][/td]"; else row += "[td][color=blue]" + QString::number(f) + "[/color][/td]"; } // 获取在线时间 MainWindow::outputInfor("获取在线时间"); QString s = "http://174.127.195.200/bbs/space.php?action=viewpro&username="******"error") { row += "[td]N/A[/td]"; ss+= "[tr]"+row+"[/tr]"; MainWindow::outputInfor(" 无法访问,可能原因:未登录 "); continue; } int a1; QString time1 = getMidString(loadresult,0,"bold",">","<",&a1); QString time2 = getMidString(loadresult,a1,"bold",">","<",&a1); QString ttt = myTr("总计在线 ")+time1+myTr(" 小时, 本月在线 ")+time2+myTr(" 小时"); if (time1<0 || ttt.size()>100) { row += "[td]N/A[/td]"; ss+= "[tr]"+row+"[/tr]"; MainWindow::outputInfor(" 无法访问,可能原因:未登录 "); continue; } MainWindow::outputInfor(ttt); row += "[td]" + time2 + "[/td]"; ss+= "[tr]"+row+"[/tr]"; } ss+= "[/table]"; qDebug()<<ss; return; auto x1 = NetworkUtil::getPosterList("5735553",-1,"5735553poster.txt"); qDebug()<<x1; QMap<QString, int> mmsi; for (int i=0; i<x1.size(); i++) { auto x = x1[i].toObject(); mmsi[x["author"].toString()] ++; } for (auto i = mmsi.begin(); i!= mmsi.end(); i++) { qDebug()<<i.key()<<' '<<*i; } }