Skip to content

Commit 35ef08d

Browse files
committed
initialize crawl
key: url
1 parent 03452de commit 35ef08d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

WebCrawler/App.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
55
</startup>
66
<appSettings>
7-
<add key="url" value="https://www.ndsu.edu/" />
7+
<add key="url" value="" />
88
<!-- What site do you want to crawl? -->
99
<add key="logTextFileName" value="C:\Users\awick\OneDrive\Documents\GitHub\WebCrawler\WebCrawler\log.txt" />
1010
<!-- Point this to some location that exists on your machine -->

WebCrawler/Model/Crawler.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,15 @@ public Crawler(IRepos externalUrlRepository, IRepos otherUrlRepository, IRepos f
7575
}
7676

7777
//Initializing the crawling process.
78-
public void InitializeCrawl(string url)
78+
public void InitializeCrawl(string key, string url)
7979
{
80-
CrawlPage(url);
80+
//var crawlUrl = ConfigurationManager.AppSettings["url"];
81+
Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
82+
configuration.AppSettings.Settings[key].Value = url;
83+
configuration.Save();
84+
85+
ConfigurationManager.RefreshSection("appSettings");
86+
//CrawlPage(ConfigurationManager.AppSettings["url"]);
8187
}
8288

8389
/*//Initialisting the reporting
@@ -108,9 +114,6 @@ private void CrawlPage(string url)
108114
//links.Add(url);
109115
log.Add(new Log($"New Entry: {url}", DateTime.Now));
110116

111-
112-
//AddUrlToList(topic);
113-
114117
linkParser.ParseLinks(page, url);
115118

116119
//Add data to main data lists

0 commit comments

Comments
 (0)