Skip to content

Ruby Google Alerts API (work with new google alerts page)

Notifications You must be signed in to change notification settings

pivotus/galerts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Galerts

Gem Version Build Status

Simple Ruby library that uses Mechanize to scrape Google Alerts from the google alerts webpage.

Features

  • List all alerts associated with account.
  • Create new alert for any google domain.
  • Update existing alert.
  • Delete an alert.
  • Find alerts by query, id, data_id, data_id_2, feed_url, domain, language, how_many, region, delivery.

Installation

gem install galerts

Example

require 'galerts'

manager = Galerts::Manager.new('[email protected]', 'password')

#   List alerts
alerts = manager.alerts
sample_alert = alerts.last

#   Create a new alert for on Google News Turkey in real time delivering alerts
#   via RSS
new_alert = manager.create("my keywords", {
  :frequency => Galerts::RT,
  :domain => 'com.tr',
  :language => "tr",
  :sources => [Galerts::NEWS],
  :how_many => Galerts::ALL_RESULTS,
  :region => "TR",
  :delivery => Galerts::RSS
  }
)

#   Update the query of this alert
sample_alert.query = "updated keyword"
manager.update(sample_alert)

#   Find examples
manager.find_by_query("keyword")
manager.find_by_delivery(Galerts::RSS)
manager.find({query: "keyword", delivery: Galerts::RSS})

#   Delete an alert
manager.delete(sample_alert)

Contribute

I need your contributions to make that work better!

License

This project licensed under MIT.

About

Ruby Google Alerts API (work with new google alerts page)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages