Skip to content

Furi/galerts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Galerts

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

Features:

  • List all alerts associated with account.

  • Create new alerts for any google domain.

  • Update existing alert: Change delivery, frequency, volume, alert type or google domain.

  • Find an alert by keyword

Issues:

  • Cant sign in to certain Google Domains (co.kr, com.hk, .se etc.)

  • Workaround: Create alerts logged out on different domains and verify them thru google.com/alerts

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

About

Ruby library to manage google alerts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%