Google Alerts Api

Introduction

Usage Example

Specifications

Download the library

Contact


Introduction

Currently does not exist an official api for google alerts, but with this php library you can create, read or delete programmatically your alerts in a very simple way.
We have the library already implemented in many other programming languages like c# and java, contact us for more information.

Usage Example

//Create a new alert for the query 'php', with default values $ga=new GAlerts('user', 'pass'); $alert=$ga->create('php'); var_dump($alert); //print out the alert data //Lists all alerts in the account $lstAlerts=$ga->getList(); var_dump($lstAlerts); //print out the array of alerts //Deletes the first alert of the account $ga->delete($lastAlerts[0]['id']);

Google Alerts Api Specifications

The class simulates the requests to the service exactly as if you were accessing with your browser.
This three simple methods is all you need to support google alerts in your application:

Class library instantiation:

public function __construct($user, $pass, $timeout=30)

Create alert api method:

/** * Creates a new alert in the system * @param string $query term to search for * @param string $lang language of the searches ('en', 'ca', 'es', 'fr'...) * @param string $frequency when the alerts are refreshed. Possible values: 'day', 'week', 'happens' * @param string $type type of the returned results. Possible values: 'all', 'news', 'blogs', 'videos', 'forums','books' * @param string $quantity number of results all or just the best. Possible values: 'best', 'all' * @param string $dest destination of the alert. Possible values: 'feed', 'email' * @return boolean true when success * @throws Exception when the server returns an incorrect response */ public function create($query, $lang='en', $frequency='happens', $type='all', $quantity='best', $dest='feed')

Delete alert api method:

/** * Deletes an alert from the system * @param str $idAlert Can be obtained with create() or getList() methods * @return boolean true when success * @throws Exception when the server returns an incorrect response */ public function delete($idAlert)

List current alerts api method:

/** * Returns an array with all the current alerts in the system * @return array with the keys: ('id', 'type', 'term', 'url'); * @throws Exception when the server returns an incorrect response */ public function getList()

Download

Last update: 11/02/2014
We are not sharing this class anymore.
You can buy the full source code with commercial license without limits for €59 / $83
We can provide an online demo before buying, feel free to contact us at googlealerts@coders11.com, we will answer immediately.



If you need this or similar functionality in any other language like perl, python, ruby or even as a webservice, contact us for more information.

comments powered by Disqus

Contact

Coders11
googlealerts@coders11.com