Exemplo n.º 1
0
        static void Main(string[] args)
        {
            newslist = new List <News>();
            feeds    = new List <SyndicationFeed>();
            htmlurls = new List <string>();

            List <string> urls = new List <string>();

            //urls.Add("http://rss.detik.com/index.php");
            //urls.Add("http://rss.vivanews.com/get/all");
            urls.Add("http://www.antaranews.com/rss/terkini");
            //urls.Add("https://www.tempo.co/rss/terkini");

            Parser parser = new Parser();

            /* XML Parser and HTML Parser*/
            parser.XMLParser(urls);
            parser.HTMLParser(htmlurls);

            foreach (var elmt in newslist)
            {
                Console.WriteLine(elmt.title);
                Console.WriteLine(elmt.summary);
                Console.WriteLine(elmt.imagelink);
                Console.WriteLine(elmt.link);
                Console.WriteLine(elmt.description);
                Console.WriteLine("\n");
            }

            Console.ReadKey();
        }