Google recently enhanced Google Alerts such that it is possible to obtain RSS feeds of canned searches.
This is enormously useful but there is no API that enables one to programaticly list, add and remove items to their set of Google Alerts. So partly because it's too cold outside to do anything and partly because this seems like useful functionality I spend a few hours today writing a PHP class that implements an API to Google Alerts.
The only required input parameters for this class are the google account username and password. Reasonable defaults are chosen for all other parameters, which can be adjusted if needed.
- username = [required] google account username
- password = [required] corrosponding google account password
- cookiefile = location of an alternate cookie file to be used. The cookie file manages and maintains the logged in session state.
- useragent = adjust the user agent presented if you feel the need.
- logtypes = an array containing the message types to be logged. Valid values are 'FATAL','ERROR','WARNING','INFO','DEBUG'.
- logterm = a bool value that determines if log messages should be sent to terminal.
Some example class instantiations:-
- $ga_api = new GoogleAlertApiClass('GOOGLE_USERNAME','GOOGLE_PASSWORD');
- $ga_api = new GoogleAlertApiClass('GOOGLE_USERNAME','GOOGLE_PASSWORD',null,null,null,FALSE);
- $ga_api = new GoogleAlertApiClass('GOOGLE_USERNAME','GOOGLE_PASSWORD',null,null,array('FATAL','ERROR','WARNING','INFO','DEBUG'),TRUE);
Functions available
- alertList() -- Can be caled once a GoogleAlertApiClass has been created. Returns an array of alert terms and their respective RSS feed URLs.
- alertAdd(string[TERM]) -- adds a new google alert. Returns 1 of sucess or 0 on failure.
- alertRemove(string[TERM]) -- removes a google alert term. Returns 1 of sucess or 0 on failure.
- alertEdit(string[OLD_TERM], string[NEW_TERM]) -- shortcut function, simply calls alertRemove and alertAdd on their respective terms. Returns 1.
- log(BOOL) -- when input is FALSE, returns an array of the last 10 enabled log type messages. When input is FALSE returns as a string.








Hi! I want to ask you about
Hi!
I want to ask you about your Google Alerts API. Can you send me the API code or documentation?
Congratulations for your project.
Thanks and greetings.
Hi, I really need the api
Hi,
I really need the api code.
Can you share your code for me please?
Very Thanks
Google enables users to
Google enables users to search the Web, Usenet, and images. Please visit slideklip.com for more information.
Hi there, It will be great if
Hi there,
It will be great if you share that.
BTW, I have a python class for GA.
anyone can convert that into javascript?
please let me know
g o ld 9 11 t ,
g. mail
How can i download or
How can i download or purchase this? :D
It's possible to access the
It's possible to access the google alerts the same way like the calendar which is capable through SOAP scripts, too.
However, it looks like Google does not like automated requests.
Can you please point me to
Can you please point me to the documentation on this? I would very much like to access (and modify) my alerts programmaticly.
Indeed interesting. Kind of
Indeed interesting. Kind of tease saying you have such a thing and not providing a download or purchase link. ;)
Would love to see it working.
Can you provide me the code
Can you provide me the code for the API? I would be interested
in using it. Or at least seeing where you started with it.
Thanks
Very interesting, do you have
Very interesting, do you have some project implementing that?
Hi, Nice concept, and very
Hi,
Nice concept, and very useful..
Please tell a litle bit more about your plans:
- Would you open the project so other can contribute?
- do you have a code base that implements the functionality?
Thanks,
JP
Hi Where can I get the API
Hi
Where can I get the API from?
Thanks
Rajan
This is a great idea and very
This is a great idea and very much needed... I'm interested..: )
I'm working on a Python
I'm working on a Python client based on http://code.google.com/p/gdata-python-client/ to do the same. Would be happy to share if you're interested.
P.S. Did you mean to post your code here too? The API isn't so useful without it ;)
Looks very interesting. I'd
Looks very interesting. I'd love to thy out the API. Could you contact me?
I am also very interested in
I am also very interested in this php class. I might even be able to contribute to it. Just let me know.
Hi I'd be interested in
Hi
I'd be interested in something like this. Would you contact me please.
Thanks
Aaron
Post new comment