How to Use ASP to Parse a Link From Google Alerts in XML
Google provides an API, or application programming interface, that lets you create software that reads from the Google Alerts application. Google Alerts provides a notice for phrases found on the Internet and indexed by the search engine. The alerts are stored in an XML data feed, so you can use ASP language to parse the XML and retrieve the link to the indexed website.
Instructions
-
-
1
Open the Visual Studio software and open the ASP Web application you want to use to parse the Google Alerts feed.
-
2
Create the connection to your Google Alerts account. The following code creates a connection and assigns the service connection to the variable named "google":
GoogleAlertService google = new GoogleAlertService("email", "password");
Replace the "email" and "password" values with the username and password you use to connect to your alerts.
-
-
3
Open the list of alerts and assign the alerts to an XML variable. The following code retrieves a list of alerts and assigns the list to a variable named "alerts":
List <GoogleAlert> alerts = google.getAlerts();
-
4
Retrieve the link and display the link to the user. The following code displays the link in the user's window:
Console.WriteLine(alert[0].getFeedURL());
-
1