public TirinhaModel(Tirinha tirinha)
     : this()
 {
     title = tirinha.Title;
     body = tirinha.Body;
     image = tirinha.Image;
     link = tirinha.Link;
     publicadoEm = tirinha.PublicadoEm;
     linkComentarios = tirinha.LinkComentarios;
     totalComentarios = tirinha.TotalComentarios;
     nova = tirinha.Nova;
 }
        public Task<IEnumerable<Tirinha>> GetPosts(int page, Func<Tirinha,bool> tirinhaLida)
        {
            var contentSteam = new MemoryStream();
            var taskCompletion = new TaskCompletionSource<IEnumerable<Tirinha>>();
            try
            {
                var webClient = WebRequest.CreateHttp(new Uri(string.Format(URL, page)));

                webClient.BeginGetResponse(ar =>
                {
                    var webResponse = webClient.EndGetResponse(ar);

                    if (ar.IsCompleted)
                    {
                        using (var streamReader = new StreamReader(webResponse.GetResponseStream()))
                        {
                            var xml = streamReader.ReadToEnd();

                            foreach (var b in Encoding.UTF8.GetBytes(xml))
                                contentSteam.WriteByte(b);

                            contentSteam.Seek(0, SeekOrigin.Begin);

                            var xDocument = XDocument.Load(contentSteam);

                            var rss = xDocument.Element("rss");

                            var wfw = rss.GetNamespaceOfPrefix(@"wfw");
                            var slash = rss.GetNamespaceOfPrefix(@"slash");

                            var imagemRegex = new Regex(IMAGEM);

                            var tirinhas = new List<Tirinha>();

                            foreach (var item in rss.Element("channel").Elements("item"))
                            {
                                string imgHtml = item.Element("description").Value;
                                string bodyHtml = item.Elements("div").FirstOrDefault(element => element.Attribute("class").Value == "transcription").Value;

                                string srcImagem = imagemRegex.Match(imgHtml).Groups["imagem"].Value;
                                string body = bodyHtml;
                                
                                var tirinha = new Tirinha(
                                    item.Element("title").Value,
                                    body.Replace("<br />", Environment.NewLine),
                                    srcImagem,
                                    item.Element("link").Value,
                                    DateTime.Parse(item.Element("pubDate").Value),
                                    item.Element(XName.Get("commentRss", wfw.NamespaceName)).Value,
                                    int.Parse(item.Element(XName.Get("comments", slash.NamespaceName)).Value)
                                );
                                tirinha.Nova = tirinhaLida(tirinha);
                                tirinhas.Add(tirinha);
                            }
                            taskCompletion.SetResult(tirinhas);
                        }
                    }
                },null);
            }
            catch (WebException e)
            {
                taskCompletion.SetException(e);
            }
            return taskCompletion.Task;
        }