Closed julioc96 closed 9 years ago
Hi @manuvo - I think the gem on rubygems and the one in this repo are different.
https://github.com/pivotus/galerts is probably what you have ended up using. I shall update the README with the same.
If you want to use this particular gem instead of the one above, then your best bet is to do the following:
$ cat Gemfile
gem 'galerts', :git => "git://github.com/amalhotra/galerts"
$ bundle
$ bundle exec irb
2.2.0 :001 > require 'galerts'
=> true
2.2.0 :002 > Galerts::AlertsManager
=> Galerts::AlertsManager
root@Test:~# ruby galerts.rb galerts.rb:3:in `': uninitialized constant Galerts::AlertsManager (NameError)
I just run the example code.
require 'galerts'
g_manager = Galerts::AlertsManager.new("juliodudu@gmail.com","*****")
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})