amalhotra / galerts

Ruby library to manage google alerts
14 stars 3 forks source link

= Status

I don't have much time to update this gem. https://github.com/pivotus/galerts seems to be a newer gem that may work better with the new google alerts api params and is also the gem pushed to rubygems.

= Galerts

Simple Ruby library that uses Mechanize to scrape Google Alerts from the google alerts webpage. A lot of the functionality was ported from https://github.com/jab/galerts

== Features:

== Issues:

== Example Code:

require 'galerts'

g_manager = Galerts::AlertsManager.new(email,password)

List alerts: Returns an Array of Alert objects (see lib/galerts/alert.rb)

my_alerts = g_manager.alerts sample_alert = my_alerts.first

Update the google domain of this alert

sample_alert.domain = "co.uk" g_manager.update(sample_alert)

Create a new alert for "ruby google alerts" on Google News Spain in real time delivering alerts via email

Note: There are defaults on the create, we list them here for better understanding

g_manager.create("ruby google alerts","es",Galerts::NEWS,Galerts::RT,Galerts::BEST_VOL,false)

Delete an alert

g_manager.delete(sample_alert)

Find an alert by passing a map of attributes

Returns an array of Alert objects

g_manager.find({:query => "ruby google alerts"}) g_manager.find({:query => "ruby google alerts",:domain => "com"}) g_manager.find({:query => "ruby google alerts",:domain => "com",:feed => true}) ..

== Limitations: Certain google domains have been known not to work. Here is a subset from http://en.wikipedia.org/wiki/List_of_Google_domains which are known not work:

.ga, .gd, .gf, .im, .io, .lc