buypeeb-cs/Settings.cs

25 lines
647 B
C#

using System;
using System.Collections.Generic;
namespace Buypeeb {
class Settings {
public Dictionary<string, Listing> watchlist;
public Settings() {
this.watchlist = new Dictionary<string, Listing>();
this.Watch("https://buypeeb.biz/whatever/k12345", "my thingy");
this.watchlist["k12345"].Update();
}
public void Watch(string url, string name) {
string id = BuypeebApp.IDFromURL(url);
Console.WriteLine(id);
this.watchlist[id] = new Listing(url, id, name);
foreach (KeyValuePair<string, Listing> entry in this.watchlist) {
Console.WriteLine("{0} - {1}", entry.Value.name, entry.Value.price);
}
}
}
}