public static void ExecuteSingleDumpScrape(MainPage mainpage, SynchronizationContext theContext, OverviewResult search) { theContext.Post((_) => { mainpage.Pivot.SelectedIndex = 1; mainpage.SkoftenDataContext.DumpItemsLoading = true; mainpage.SkoftenDataContext.DumpItems.Clear(); }, null); DumpExecute execute = new DumpExecute(); execute.Parameters.Url = search.Url; execute.Parameters.Type = mainpage.SkoftenDataContext.CurrentGalleryType; execute.Execute(); var dumpItems = execute.Result; theContext.Post((_) => { mainpage.SkoftenDataContext.InitializeNewDumpList(dumpItems); }, null); }
public OverviewResult ConvertSingleResult(HtmlNode node) { OverviewResult result = new OverviewResult(); result.Url = node.Descendants("a").FirstOrDefault()?.Attributes["href"]?.Value; result.Type = node.Descendants("p").FirstOrDefault(p => p.Attributes["class"]?.Value?.Contains("description") ?? false)?.InnerText; result.Name = System.Net.WebUtility.HtmlDecode(node.Descendants("h3").FirstOrDefault()?.InnerText); result.ImageUrl = node.Descendants("img").FirstOrDefault()?.Attributes["src"]?.Value; if (!result.Url.StartsWith("http://")) { if(Parameters.Type == Parameter.OverviewType.PicDump || Parameters.Type == Parameter.OverviewType.GifDump) result.Url = $"http://www.skoften.net/{result.Url}"; else if (Parameters.Type == Parameter.OverviewType.EroDump) result.Url = $"http://babes.skoften.net/{result.Url}"; } return result; }