#include "scrawler.h"

#include <QCoreApplication>
#include <iostream>
#include <QSqlDatabase>
#include <QNetworkProxy>
#include <time.h>
#include <QDateTime>
using namespace std;

int main(int argc, char *argv[])
{
    //srand(time(0));
    QApplication a(argc, argv);
    //QDateTime start = QDateTime::currentDateTime();

    a.setApplicationName(QString("Google Chrome"));
    a.setApplicationVersion(QString("43.0.2357.81"));

    SCrawler *process = new SCrawler;
    QObject::connect(process, SIGNAL(finished()), QApplication::instance(), SLOT(quit()));

    QWebSettings::setObjectCacheCapacities(0,0,0);
    QWebSettings::clearMemoryCaches();

    QStringList strArgv;
    for (int i = 1; i < argc ; i++)
        strArgv.push_back(argv[i]);

    process->load(strArgv);

    a.exec();
    //QDateTime end = QDateTime::currentDateTime();
    //QDateTime interval = end - start;
    //cout << start.toString("yyyy-MM-dd hh:mm:ss").toStdString() << endl;
    //cout << end.toString("yyyy-MM-dd hh:mm:ss").toStdString() << endl;
    return 0;
}
