55 lines
1.1 KiB
C#
55 lines
1.1 KiB
C#
using System;
|
|
using System.IO;
|
|
using Newtonsoft.Json;
|
|
using System.Threading;
|
|
|
|
namespace RetroExtractor
|
|
{
|
|
public class Range
|
|
{
|
|
public int Year;
|
|
public int Month;
|
|
public int Day;
|
|
|
|
public DateTime GetDate()
|
|
{
|
|
return new DateTime(Year, Month, Day);
|
|
}
|
|
}
|
|
|
|
public class ScrapeRange
|
|
{
|
|
public Range Start;
|
|
public Range End;
|
|
}
|
|
|
|
public class ArticleRange
|
|
{
|
|
public bool ApplyFilter;
|
|
public Range Start;
|
|
public Range End;
|
|
}
|
|
|
|
public class configuration
|
|
{
|
|
public string BaseFolder;
|
|
public ScrapeRange ScrapeDate;
|
|
public ArticleRange ArticleDate;
|
|
public string[] PubSelection;
|
|
public string OutputFolder;
|
|
}
|
|
|
|
static class config
|
|
{
|
|
public static configuration param;
|
|
|
|
public static void populate(string configpath)
|
|
{
|
|
StreamReader sr = new StreamReader(configpath);
|
|
param = JsonConvert.DeserializeObject<configuration>(sr.ReadToEnd());
|
|
}
|
|
|
|
}
|
|
|
|
}
|