public async Task<List<Models.Ui.HomeItem>> GetUpdates(string category, Interfaces.IStorage storage) { List<Models.Ui.HomeItem> LastResult = new List<Models.Ui.HomeItem>(); List<Models.Ui.HomeItem> OutResult = new List<Models.Ui.HomeItem>(); try { var onld = await storage.Exists(Constants.StorageKeys.AGENT_DATA); if (onld) { var lastResultjson = await storage.ReadData(Constants.StorageKeys.AGENT_DATA); LastResult = lastResultjson.LoadFromJson<List<Models.Ui.HomeItem>>(); } var current = await service.GetPostsFrom(category, 0); foreach (var item in current.posts) { string img = item.thumbnail; if (string.IsNullOrEmpty(img)) { img = Regex.Match(item.content, "<img.+?src=[\"'](.+?)[\"'].+?>", RegexOptions.IgnoreCase).Groups[1].Value; } var p = new Models.Ui.HomeItem { Title = item.title_plain, Resume = item.excerpt, CategoryId = "112", Date = item.date, UniqueId = item.id.ToString(), Url = img, Author = item.author.name }; if (!LastResult.Any(o => o.UniqueId ==p.UniqueId)) { OutResult.Add(p); } } } catch (Exception ex) { throw ex; } // await storage.WriteData(Constants.StorageKeys.AGENT_DATA, Result.SaveAsJson()); return OutResult; }