Google announced a wonderful service called Google Alerts lately.
Unfortunately, Google hasn’t published an API for Google Alerts, yet. I know how frustrating is to search for an API and can’t find it. So I decided to code a PHP class to use Google Alerts programmatically.
You would be able to add alerts, delete alerts and list alerts by my Google Alerts API Class.
It is very simple to use. To use it;
1. Include it to your PHP code:
include('alerts.php');
2. Call the class:
$alerts = new GoogleAlerts();
3. Define the username and password of your Google account:
$alerts->username = '';
$alerts->password = '';
And you would be able to list your alerts, add new alert and delete an alert now.
To List Google Alerts:
$alerts->listAlerts();
This code will return an array like this:
Array
(
[0] => Array
(
[s] => AB2Xq4hCMYO4rAnGLE_dX_g1s0VFPOvDsES-Y5Y
[string] => oktay kilic
[feed] => http://www.google.com/alerts/feeds/16833094743212089380/8815252463603277810
)[1] => Array
(
[s] => AB2Xq4hybmv6-xhVJt-7zp61iRiEQ5aIAdoMHhI
[string] => test
[feed] => http://www.google.com/alerts/feeds/16833094743212089380/8505692390365346203
))To Add A New Alert:
$alerts->addAlert('test');
This code will return the info of the added alert like list function.
To Delete A Google Alert:
$alerts->deleteAlert('AB2Xq4hCMYO4rAnGLE_dX_g1s0VFPOvDsES-Y5Y‘); // s value
You see it’s very simple.
I’m selling the Google Alerts API Class for only $25, please contact me to buy it. I can also integrate the code in your application.
My email address is: info [at] oktaykilic.com
P.S: You need to clear your cookie.txt file contents to use another google account .