-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
46 lines (43 loc) · 1.32 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using CrazyScraper.Commands;
using CrazyScraper.Services;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.IO;
using System.Threading.Tasks;
/*
* TODO:
* - Features for Scraping Javascript Rendered Websites
* - Scrape Stock Websites for prices
* - Scrape Whether Temperature Forecast Websites
* - Scrape Facebook Website
* - Scrape Twitter
*/
namespace CrazyScraper
{
class Program
{
static async Task Main(string[] args)
{
var Configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile(AppDomain.CurrentDomain.BaseDirectory + "\\appsettings.json", optional: true, reloadOnChange: true)
.Build();
var builder = new HostBuilder()
.ConfigureServices((hostContext, services) =>
{
services.AddSingleton<InstagramService>();
hostContext.Configuration = Configuration;
});
try
{
await builder.RunCommandLineApplicationAsync<MainCommand>(args);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}