Ejemplo n.º 1
0
 public WebDocumentLoader(wininetWrapper oWinInet)
 {
     oWININET = oWinInet;
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.BelowNormal;
            try
            {
                Boolean bShallProceed = false;
                wininetWrapper wininet = new wininetWrapper();
                String sStartPage = BlackSEOps.Properties.Settings.Default["sPage4GoogleSEO"].ToString();

                System.Windows.Forms.WebBrowser oBrowser = new System.Windows.Forms.WebBrowser();
                oBrowser.ScriptErrorsSuppressed = true;
                SiteCrawler oSiteCrawler = new SiteCrawler(wininet);
                Dictionary<String, HashSet<String>> oSiteText = oSiteCrawler.getSiteText(ref oBrowser, "http://kreuzerkrieg.dyndns.info/SiteMap.xml");
                foreach (String sKey in oSiteText.Keys)
                {
                    YahooSEO oYahooAbuser = new YahooSEO();
                    GoogleSEO oGoogleAbuser = new GoogleSEO();
                    BingSEO oBingAbuser = new BingSEO();
                    Thread oYahooThread = new Thread(oYahooAbuser.StartAbuse);
                    Thread oGoogleThread = new Thread(oGoogleAbuser.StartAbuse);
                    Thread oBingThread = new Thread(oBingAbuser.StartAbuse);

                    try
                    {
                        oBrowser.Dispose();
                        if (String.IsNullOrEmpty(sStartPage) || sKey == sStartPage)
                            bShallProceed = true;
                        if (!bShallProceed)
                            continue;
                        BlackSEOps.Properties.Settings.Default["sPage4GoogleSEO"] = sKey;

                        System.Console.WriteLine("Bumping page: " + sKey);

                        oYahooThread.SetApartmentState(ApartmentState.STA);
                        oYahooThread.Priority = ThreadPriority.BelowNormal;
                        oYahooThread.Name = "YAhOOViOlAtOR";
                        oYahooThread.Start(oSiteText[sKey]);
                        Thread.Sleep(100);
                        oGoogleThread.SetApartmentState(ApartmentState.STA);
                        oGoogleThread.Priority = ThreadPriority.BelowNormal;
                        oGoogleThread.Name = "GOOGlEViOlAtOR";
                        oGoogleThread.Start(oSiteText[sKey]);
                        Thread.Sleep(100);
                        oBingThread.SetApartmentState(ApartmentState.STA);
                        oBingThread.Priority = ThreadPriority.BelowNormal;
                        oBingThread.Name = "BiNGViOlAtOR";
                        oBingThread.Start(oSiteText[sKey]);
                        Thread.Sleep(100);
                        while (!oYahooThread.IsAlive ||
                            !oGoogleThread.IsAlive ||
                            !oBingThread.IsAlive) ;

                        oYahooThread.Join();
                        oGoogleThread.Join();
                        oBingThread.Join();
                        BlackSEOps.Properties.Settings.Default.Save();
                    }
                    catch (Exception ex)
                    {
                        System.Console.WriteLine("Main has thrown an exception. Reason: " + ex.Message);
                        oYahooThread.Abort();
                        oGoogleThread.Abort();
                        oBingThread.Abort();
                        System.Console.WriteLine("Worker threads aborted, starting over...");
                    }
                }
            }
            catch (AccessViolationException ex)
            {
                System.Console.WriteLine("Main has thrown an exception. Reason: " + ex.Message);
                //die in solitude
            }
            catch (Exception ex)
            {
                System.Console.WriteLine("Main has thrown an exception. Reason: " + ex.Message);
                //die in solitude
            }
        }
Ejemplo n.º 3
0
 public SiteCrawler(wininetWrapper oWinInet)
 {
     oWININET = oWinInet;
 }
Ejemplo n.º 4
0
 public FatherOfBlackSEOps()
 {
     wininet = new wininetWrapper();
     oRandomizer = new Random();
     oDocLoader = new WebDocumentLoader(wininet);
 }