Skip to content

Instantly share code, notes, and snippets.

@squadwuschel
Created March 11, 2017 13:35
Show Gist options
  • Save squadwuschel/8edf49831378e9fa9f1dab65aac6901d to your computer and use it in GitHub Desktop.
Save squadwuschel/8edf49831378e9fa9f1dab65aac6901d to your computer and use it in GitHub Desktop.
this.StartStop = !this.StartStop;
var nextChangeId = "";
while (StartStop)
{
using (WebClient wc = new WebClient())
{
var url = "http://www.pathofexile.com/api/public-stash-tabs";
if (!string.IsNullOrEmpty(nextChangeId))
{
url = $"http://www.pathofexile.com/api/public-stash-tabs?id={nextChangeId}";
}
var json = wc.DownloadString(url);
var root = Newtonsoft.Json.JsonConvert.DeserializeObject<Rootobject>(json);
nextChangeId = root.next_change_id;
//var stashes = root.stashes.Where(p => p.items.Length > 0 && (p.stash.StartsWith("~") || p.items.Any(x=> x.note != null && x.note.StartsWith("~"))) && p.items.Any(x=> x.name.ToLower().Contains(this.Suche.Text)));
var stashes = root.stashes.Where(p => p.accountName.ToLower().Contains("squad") || p.lastCharacterName.ToLower().Contains("squad"));
var liga = root.stashes.Where(p => p.items.Any(x => x.league != "Hardcore"));
if (stashes.Any())
{
stashes.ToList().ForEach(p =>
{
this.AusgabeText.Text += $"Name {p.accountName} {Environment.NewLine}";
});
//stashes.ToList().ForEach(item =>
//{
// var foundItem = item.items.FirstOrDefault(p => p.name.ToLower().Contains(this.Suche.Text));
// this.AusgabeText.Text += $"{DateTime.Now.ToLongTimeString()} Accountname: {item.accountName} | LastCharName: {item.accountName} | Stash: {item.stash} | Note {foundItem.note} | Item {foundItem.name} {Environment.NewLine}";
//});
}
System.IO.File.WriteAllText(@"c:\Temp\poeausgabe.txt", this.AusgabeText.Text);
Thread.Sleep(2000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment