governator 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e89dcfc60bccb89d0080d03ca2b0b606192a19d9
4
- data.tar.gz: 322faf0a64187c9b9fda0889a98a9adbe5648e50
3
+ metadata.gz: 42222b98c784c73697e11f2f674eedc3cf5eb83f
4
+ data.tar.gz: c701edfb91d64cf72ecccf422ca6bc8cae6c2e01
5
5
  SHA512:
6
- metadata.gz: 2600672ed050b4e7431e01c94dd369f494e61a9c93088238f16e05620a8cff1b66df83c27d5a676bb7070a2e83f8f41d1a59de52ea4c0c28db5ef6fc36e01200
7
- data.tar.gz: 2f6d3be6510ae7087b63fa865498d77d06b7b3f03e7cb31a4c1b9d287dd6fc0cc851d9182e66e7e989f90f0aab4c686b0e7997e385bb30c0423a2b45f0fe04fa
6
+ metadata.gz: 93519716cd823c984c349b2e4733f6bc7f58298b763077243a3e42a3904c5320cb8bc356951c1134808a35f6d78c52d087f7b93c3aad6821732633e2af1db92a
7
+ data.tar.gz: ecac5f3c8c5dc211e64adbcfd958afe1dba7fb774fa3e8537de8f1c608e46c729415ecded329ce9f988010639e2d68060c8cde4e75247275ed47d59c7e35beaf
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Governator
1
+ ![Governator](http://msimonborg.com/governator/governator.png)
2
2
 
3
- Scraper for the data on US Governors.
3
+ Scraper for data on US Governors.
4
4
 
5
5
  ## Installation
6
6
 
@@ -33,12 +33,12 @@ If you want to scrape Twitter handles you will need to initialize the client. Ad
33
33
  ```ruby
34
34
  Governator.config do |config|
35
35
  config.use_twitter = true
36
-
36
+
37
37
  config.twitter do |twitter|
38
- twitter.consumer_key = YOUR_CONSUMER_KEY
38
+ twitter.consumer_key = YOUR_TWITTER_CONSUMER_KEY
39
39
  twitter.consumer_secret = YOUR_TWITTER_CONSUMER_SECRET
40
- twitter.access_token = YOUR_ACCESS_TOKEN
41
- twitter.access_token_secret = YOUR_ACCESS_TOKEN_SECRET
40
+ twitter.access_token = YOUR_TWITTER_ACCESS_TOKEN
41
+ twitter.access_token_secret = YOUR_TWITTER_ACCESS_TOKEN_SECRET
42
42
  end
43
43
  end
44
44
  ```
data/bin/console CHANGED
@@ -9,14 +9,10 @@ Governator.config do |config|
9
9
  config.twitter do |twitter|
10
10
  twitter.consumer_key = ENV['TWITTER_CONSUMER_KEY']
11
11
  twitter.consumer_secret = ENV['TWITTER_CONSUMER_SECRET']
12
- twitter.access_token = ENV['ACCESS_TOKEN']
13
- twitter.access_token_secret = ENV['ACCESS_TOKEN_SECRET']
12
+ twitter.access_token = ENV['TWITTER_ACCESS_TOKEN']
13
+ twitter.access_token_secret = ENV['TWITTER_ACCESS_TOKEN_SECRET']
14
14
  end
15
15
  end
16
16
 
17
- # (If you use this, don't forget to add pry to your Gemfile!)
18
17
  require 'pry'
19
18
  Pry.start
20
-
21
- # require "irb"
22
- # IRB.start(__FILE__)
data/governator.png ADDED
Binary file
@@ -2,36 +2,40 @@
2
2
 
3
3
  class Governator
4
4
  class TwitterClient
5
- def self.client(&block)
6
- @_client ||= Twitter::REST::Client.new(&block)
7
- end
5
+ class << self
6
+ attr_reader :client
8
7
 
9
- def self.governors
10
- @_governors ||= nga_list_members + rga_list_members + cspan_list_members
11
- end
8
+ def config(&block)
9
+ @client = Twitter::REST::Client.new(&block)
10
+ end
12
11
 
13
- def self.nga_list
14
- @_nga_list ||= client.lists('NatlGovsAssoc').detect { |l| l.name == 'Governors' }
15
- end
12
+ def governors
13
+ @_governors ||= nga_list_members + rga_list_members + cspan_list_members
14
+ end
16
15
 
17
- def self.nga_list_members
18
- @_nga_list_members ||= client.list_members(nga_list, count: 100).attrs[:users]
19
- end
16
+ def nga_list
17
+ @_nga_list ||= client.lists('NatlGovsAssoc').detect { |l| l.name == 'Governors' }
18
+ end
20
19
 
21
- def self.rga_list
22
- @_rga_list ||= client.lists('The_RGA').detect { |l| l.name == 'GOP Governors' }
23
- end
20
+ def nga_list_members
21
+ @_nga_list_members ||= client.list_members(nga_list, count: 100).attrs[:users]
22
+ end
24
23
 
25
- def self.rga_list_members
26
- @_rga_list_members ||= client.list_members(rga_list, count: 100).attrs[:users]
27
- end
24
+ def rga_list
25
+ @_rga_list ||= client.lists('The_RGA').detect { |l| l.name == 'GOP Governors' }
26
+ end
28
27
 
29
- def self.cspan_list
30
- @_cspan_list ||= client.lists('cspan').detect { |l| l.name == 'Governors' }
31
- end
28
+ def rga_list_members
29
+ @_rga_list_members ||= client.list_members(rga_list, count: 100).attrs[:users]
30
+ end
31
+
32
+ def cspan_list
33
+ @_cspan_list ||= client.lists('cspan').detect { |l| l.name == 'Governors' }
34
+ end
32
35
 
33
- def self.cspan_list_members
34
- @_cspan_list_members ||= client.list_members(cspan_list, count: 100).attrs[:users]
36
+ def cspan_list_members
37
+ @_cspan_list_members ||= client.list_members(cspan_list, count: 100).attrs[:users]
38
+ end
35
39
  end
36
40
  end
37
41
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Governator
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
data/lib/governator.rb CHANGED
@@ -43,7 +43,7 @@ class Governator
43
43
  end
44
44
 
45
45
  def twitter(&block)
46
- TwitterClient.client(&block)
46
+ TwitterClient.config(&block)
47
47
  end
48
48
 
49
49
  def use_twitter=(boolean)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: governator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - M. Simon Borg
@@ -96,6 +96,7 @@ files:
96
96
  - bin/console
97
97
  - bin/setup
98
98
  - governator.gemspec
99
+ - governator.png
99
100
  - lib/governator.rb
100
101
  - lib/governator/bio_page.rb
101
102
  - lib/governator/name_parser.rb