Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var input = this.textBox1.Text.Trim();

            if (string.IsNullOrEmpty(input))
            {
                return;
            }
            foreach (var item in ParserManager.GetLinks(input))
            {
                var parser = ParserManager.GetNewsParser(item);
                if (parser == null)
                {
                    continue;
                }
                this.newList.Add(new NewsModel()
                {
                    Author           = parser.Author,
                    Content          = parser.Content,
                    ContentSourceUrl = parser.Url,
                    Url              = string.Empty,
                    CreatedBy        = string.Empty,
                    CreatedOn        = DateTime.UtcNow,
                    UpdatedBy        = string.Empty,
                    UpdatedOn        = DateTime.UtcNow,
                    Digest           = parser.Digest,
                    Id               = Guid.NewGuid().ToString("N"),
                    IsReleased       = false,
                    LastUpdateTime   = DateTime.UtcNow,
                    MaterialID       = string.Empty,
                    MediaId          = string.Empty,
                    OfficialAccount  = string.Empty,
                    ShowCoverPicture = false,
                    SortBy           = 0,
                    ThumbMediaId     = parser.ThumbMedia,
                    Title            = parser.Title
                });
            }
        }