-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProgram.cs
63 lines (54 loc) · 2.08 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using static doginals.Program;
namespace doginals
{
internal partial class Program
{
static void Main(string[] args)
{
var doginal = new Doginal();
var result = doginal.GetItems(1).Result;
var fullResults = new List<DoginalResultData>();
var totalPage = result.totalPages;
// totalPage = 2;
for (int i = 1; i <= totalPage; i++)
{
Console.WriteLine($"Getting {i}. page...");
result = doginal.GetItems(i).Result;
fullResults.AddRange(result.data);
Thread.Sleep(100);
}
var nonMinted = fullResults.Where(c => c.minted < c.supply && c.holders > 9).OrderByDescending(c => c.holders).ToList();
var outputFile = @"c:\temp\doginal.txt";
var holderHeader = "";
for (int i = 0; i < 10; i++)
{
holderHeader += $"\tHolder {(i+1).ToString()}";
}
holderHeader = $"Tick\tHolders\tLimitPerMint\tTotalSupply\tMinted{holderHeader}\r\n";
File.WriteAllText(outputFile, holderHeader);
Console.WriteLine(holderHeader);
foreach (var item in nonMinted)
{
var output = $"{item.tick}\t{item.holders}\t{item.limitPerMint}\t{item.supply}\t{item.minted}";
var holderpercs = "";
try
{
var holderInfo = doginal.GetHolderInfo(item.tick).Result;
foreach (var holder in holderInfo)
{
holderpercs += $"\t{holder.percentage}";
}
}
catch (Exception ex)
{
Console.WriteLine($"error happened for ticker {item.tick}");
}
output += holderpercs;
Console.WriteLine(output);
File.AppendAllText(outputFile, output + "\r\n");
Thread.Sleep(100);
}
Console.WriteLine("finished...");
}
}
}