Sign in to follow this  
Followers 0
VIP

Web parser tutorial

4 posts in this topic

using System;using System.Diagnostics;using System.Drawing;using System.Net;using System.Threading;using System.Windows.Forms;namespace GTA_SA_Release_Notify{    internal class Program    {        private static void Main()        {            var wc = new WebClient();            Reset:            string page =                wc.DownloadString(new Uri("https://play.google.com/store/apps/developer?id=Rockstar+Games,+Inc.")); //Download page            Console.WriteLine("Checked on " + DateTime.Now.ToString("HH:mm:ss tt"));            if (page.Contains("San Andreas")) //Parse it            {                Console.WriteLine("Released on " + DateTime.Now.ToString("HH:mm:ss tt"));                ShowBalloon("San Andreas is here", "Click to open");                return; //Exit app            }            Thread.Sleep(600000); //Wait before loading it again            goto Reset; //Do all again        }        private static void ShowBalloon(string title, string body) //Notification        {            var notifyIcon = new NotifyIcon {Visible = true, Icon = SystemIcons.Application};            notifyIcon.Click += notifyIcon_Click;            if (title != null)            {                notifyIcon.BalloonTipTitle = title;            }            if (body != null)            {                notifyIcon.BalloonTipText = body;            }            notifyIcon.ShowBalloonTip(30000);        }        private static void notifyIcon_Click(object sender, EventArgs e) //Open webpage        {            Process.Start("https://play.google.com/store/apps/developer?id=Rockstar+Games,+Inc.");        }    }}

Press like to get more fine tutorials from me

3 people like this

Share this post


Link to post
Share on other sites
using System;using System.Diagnostics;using System.Drawing;using System.Net;using System.Threading;using System.Windows.Forms;namespace GTA_SA_Release_Notify{    internal class Program    {        private static void Main()        {            var wc = new WebClient();            Reset:            string page =                wc.DownloadString(new Uri("https://play.google.com/store/apps/developer?id=Rockstar+Games,+Inc.")); //Download page            Console.WriteLine("Checked on " + DateTime.Now.ToString("HH:mm:ss tt"));            if (page.Contains("San Andreas")) //Parse it            {                Console.WriteLine("Released on " + DateTime.Now.ToString("HH:mm:ss tt"));                ShowBalloon("San Andreas is here", "Click to open");                return; //Exit app            }            Thread.Sleep(600000); //Wait before loading it again            goto Reset; //Do all again        }        private static void ShowBalloon(string title, string body) //Notification        {            var notifyIcon = new NotifyIcon {Visible = true, Icon = SystemIcons.Application};            notifyIcon.Click += notifyIcon_Click;            if (title != null)            {                notifyIcon.BalloonTipTitle = title;            }            if (body != null)            {                notifyIcon.BalloonTipText = body;            }            notifyIcon.ShowBalloonTip(30000);        }        private static void notifyIcon_Click(object sender, EventArgs e) //Open webpage        {            Process.Start("https://play.google.com/store/apps/developer?id=Rockstar+Games,+Inc.");        }    }}

Press like to get more fine tutorials from me

 

Lack of tutorial.

only code.

1 person likes this

Share this post


Link to post
Share on other sites

lack of comments a programmers shame should this code ever be updated in the future by a thirdparty coder he'd have it harder than if it actually contained said comments

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0