galerts 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +25 -0
- data/Gemfile +4 -0
- data/README.md +7 -1
- data/Rakefile +7 -0
- data/lib/galerts/manager.rb +4 -4
- data/lib/galerts/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 754bc4e4b5883644b7a93a63a3372d1086d43741
|
4
|
+
data.tar.gz: 011be19a0fab9712232f7c8710d65dbbeabc8ef3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4390f68cc9dd7a3da82a00ddaf777aa03425cd4a0f6bf0981d7888d36b4bc797eb6e66e271e4d9a1ae38fa46c7a035d7feec9578a38bed2085fc29ed10b1c1db
|
7
|
+
data.tar.gz: dfaa9fcfd4a287c46ce6e22956d239b7311f4b9486712f4269a2b48332d42db1dc1d9dac0b633ecbeba202879c9cec38245923accd39d2ee8d46748031b5cb44
|
data/.travis.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.1.0
|
4
|
+
- 2.0.0
|
5
|
+
- 1.9.3
|
6
|
+
- ruby-head
|
7
|
+
matrix:
|
8
|
+
include:
|
9
|
+
- rvm: jruby-19mode
|
10
|
+
- rvm: jruby-20mode
|
11
|
+
- rvm: jruby-21mode
|
12
|
+
- rvm: jruby-head
|
13
|
+
- rvm: rbx-2
|
14
|
+
allow_failures:
|
15
|
+
- rvm: jruby-20mode
|
16
|
+
- rvm: jruby-21mode
|
17
|
+
- rvm: ruby-head
|
18
|
+
- rvm: jruby-head
|
19
|
+
- rvm: rbx
|
20
|
+
- rvm: rbx-2
|
21
|
+
fast_finish: true
|
22
|
+
branches:
|
23
|
+
only: master
|
24
|
+
|
25
|
+
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Galerts
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/galerts.png)][gem]
|
4
|
+
[![Build Status](https://secure.travis-ci.org/pivotus/galerts.png?branch=master)][travis]
|
5
|
+
|
6
|
+
[gem]: http://badge.fury.io/rb/galerts
|
7
|
+
[travis]: http://travis-ci.org/pivotus/galerts
|
8
|
+
|
3
9
|
Simple Ruby library that uses Mechanize to scrape Google Alerts from the google
|
4
10
|
alerts webpage.
|
5
11
|
|
@@ -21,7 +27,7 @@ gem install galerts
|
|
21
27
|
## Example
|
22
28
|
|
23
29
|
```ruby
|
24
|
-
require '
|
30
|
+
require 'galerts'
|
25
31
|
|
26
32
|
manager = Galerts::Manager.new('example@gmail.com', 'password')
|
27
33
|
|
data/Rakefile
CHANGED
data/lib/galerts/manager.rb
CHANGED
@@ -54,9 +54,9 @@ module Galerts
|
|
54
54
|
|
55
55
|
contents[1][1].each do |alert|
|
56
56
|
result << Alert.new(alert[2][3][1], {
|
57
|
-
id: alert[2]
|
57
|
+
id: alert[2][6][0][11],
|
58
58
|
query: alert[2][3][1],
|
59
|
-
feed_url: "#{ALERTS_URL}/feeds/#{alert.last}/#{alert[2]
|
59
|
+
feed_url: "#{ALERTS_URL}/feeds/#{alert.last}/#{alert[2][6][0][11]}",
|
60
60
|
data_id: alert[1],
|
61
61
|
domain: alert[2][3][2],
|
62
62
|
language: alert[2][3][3][1],
|
@@ -130,7 +130,7 @@ module Galerts
|
|
130
130
|
response = @agent.post("#{CREATE_ALERT_URL}x=#{x}", build_params(alert, 0), {'Content-Type' => 'application/x-www-form-urlencoded'})
|
131
131
|
|
132
132
|
if response.body == ALERT_EXIST
|
133
|
-
|
133
|
+
find_by_query(query).first
|
134
134
|
elsif response.body == ALERT_SOMETHING_WENT_WRONG
|
135
135
|
raise "Something went wrong!" # internal error, html changed maybe
|
136
136
|
else
|
@@ -151,7 +151,7 @@ module Galerts
|
|
151
151
|
response = @agent.post("#{MODIFY_ALERT_URL}x=#{x}", build_params(alert, 1), {'Content-Type' => 'application/x-www-form-urlencoded'})
|
152
152
|
|
153
153
|
if response.body == ALERT_EXIST
|
154
|
-
|
154
|
+
find_by_query(query).first
|
155
155
|
elsif response.body == ALERT_SOMETHING_WENT_WRONG
|
156
156
|
raise "Something went wrong!" # internal error, html changed maybe
|
157
157
|
else
|
data/lib/galerts/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: galerts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emre Can Yılmaz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -31,6 +31,7 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
+
- ".travis.yml"
|
34
35
|
- Gemfile
|
35
36
|
- README.md
|
36
37
|
- Rakefile
|