Exemple #1
0
        public void AddLinkForParsing(string URL)
        {
            CloudQueue        crawlQueue = CloudConfiguration.GetCrawlingQueue();
            CloudQueueMessage message    = new CloudQueueMessage(URL);

            crawlQueue.AddMessage(message);
        }
Exemple #2
0
        public void AddSitemap(string URL)
        {
            CloudQueue        loadQueue = CloudConfiguration.GetLoadingQueue();
            CloudQueueMessage message   = new CloudQueueMessage(URL);

            loadQueue.AddMessage(message);
        }
Exemple #3
0
        public AdminStatus(string state, int cpu, int mem)
        {
            this.PartitionKey = "Dashboard Status";
            this.RowKey       = "Row";
            State             = state;
            CPUCounter        = cpu;
            MemCounter        = mem;
            NumCrawled        = 0;
            Last10CrawledList = new List <string>();
            Last10Crawled     = "";
            CloudQueue temp = CloudConfiguration.GetCrawlingQueue();

            temp.FetchAttributes();
            QueueSize = temp.ApproximateMessageCount.ToString();
        }
Exemple #4
0
        public void AddLinkToResults(string URL, string title, DateTime date)
        {
            CloudTable table = CloudConfiguration.GetSiteDataTable();

            string[] words = title.Split(null);             // split title on whitespace
            foreach (string s in words)
            {
                string    keyword   = s.ToLower();
                URLEntity linkEntry = new URLEntity(URL, keyword, title, date);

                // Create the TableOperation object that inserts the customer entity.
                TableOperation insertOperation = TableOperation.Insert(linkEntry);

                try
                {
                    // Execute the insert operation.
                    table.Execute(insertOperation);
                } catch (Exception ex)
                {
                    Debug.Print(ex.Message);
                }
            }
        }