governator 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/governator.gemspec +2 -0
- data/lib/governator/bio_page.rb +1 -1
- data/lib/governator/version.rb +1 -1
- data/lib/governator.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 74a7686c22cba09e8aa50f5d696b063ab79f1720
|
|
4
|
+
data.tar.gz: cf8c6c80b7ba5c53ac84ba2841b645f9d156fc52
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d8dd89e1fbbbb6824ef258143836d045598b67c6212d8a74d0ffea008ee4e4cd0d9403e058799a62129d544002a962bab74a8fc3ab31ef6c2b42ad509d42419
|
|
7
|
+
data.tar.gz: 1489ec8eadcedd71e9b0310d13bdbde1e59960eb7e2d70bff6a44e4abb876c3d6448df313fd483f5de150489f9f7bd98e0ddb758275e63a1b61143700b02de56
|
data/README.md
CHANGED
|
@@ -28,7 +28,7 @@ governors = Governator.governors
|
|
|
28
28
|
|
|
29
29
|
## Twitter
|
|
30
30
|
|
|
31
|
-
If you want to scrape Twitter handles you will need to initialize the client. Add this to your code (in a Rails app it should probably go in a file called `governator.rb` in `./config/initializers/`)
|
|
31
|
+
If you want to scrape Twitter for Twitter handles (recommended for best data results) you will need to initialize the client. Add this to your code (in a Rails app it should probably go in a file called `governator.rb` in `./config/initializers/`).
|
|
32
32
|
|
|
33
33
|
```ruby
|
|
34
34
|
Governator.config do |config|
|
|
@@ -42,6 +42,7 @@ Governator.config do |config|
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
```
|
|
45
|
+
More info can be found [here](https://github.com/sferik/twitter#configuration). When configured you can access the full Twitter gem client API with `Governator.twitter_client`.
|
|
45
46
|
|
|
46
47
|
As with everything, secrets should never be stored anywhere public, like version control. Set these values as variables on your system.
|
|
47
48
|
|
data/governator.gemspec
CHANGED
|
@@ -21,6 +21,8 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
22
22
|
spec.require_paths = ['lib']
|
|
23
23
|
|
|
24
|
+
spec.required_ruby_version = '>= 2.3'
|
|
25
|
+
|
|
24
26
|
spec.add_dependency 'faraday', '~> 0.11.0'
|
|
25
27
|
spec.add_dependency 'twitter', '~> 6.1.0'
|
|
26
28
|
spec.add_dependency 'nokogiri', '~> 1.8.0'
|
data/lib/governator/bio_page.rb
CHANGED
data/lib/governator/version.rb
CHANGED
data/lib/governator.rb
CHANGED
|
@@ -144,8 +144,8 @@ class Governator
|
|
|
144
144
|
def fetch_twitter_handle
|
|
145
145
|
if self.class.use_twitter == true
|
|
146
146
|
twitter_governor = TwitterClient.governors.detect do |tg|
|
|
147
|
-
tg[:name].match
|
|
148
|
-
tg[:location].match
|
|
147
|
+
tg[:name].match(last) && (
|
|
148
|
+
tg[:location].match(state_name) || tg[:description].match(state_name)
|
|
149
149
|
)
|
|
150
150
|
end
|
|
151
151
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: governator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- M. Simon Borg
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-06-
|
|
11
|
+
date: 2017-06-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -110,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
110
110
|
requirements:
|
|
111
111
|
- - ">="
|
|
112
112
|
- !ruby/object:Gem::Version
|
|
113
|
-
version: '
|
|
113
|
+
version: '2.3'
|
|
114
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
requirements:
|
|
116
116
|
- - ">="
|
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
118
118
|
version: '0'
|
|
119
119
|
requirements: []
|
|
120
120
|
rubyforge_project:
|
|
121
|
-
rubygems_version: 2.
|
|
121
|
+
rubygems_version: 2.5.1
|
|
122
122
|
signing_key:
|
|
123
123
|
specification_version: 4
|
|
124
124
|
summary: Scraper for data on US Governors
|