sunlightpartytime 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/sunlightpartytime.rb +4 -6
  2. metadata +2 -2
@@ -6,10 +6,6 @@ class SunlightPartyTime
6
6
  @apikey = apikey
7
7
  end
8
8
 
9
- # Update gem
10
- # Push to git
11
- # Add to TT
12
-
13
9
  # Get legislator ID
14
10
  def crp_id(name)
15
11
  options = {:query => {:apikey => @apikey} }
@@ -26,14 +22,16 @@ class SunlightPartyTime
26
22
  end
27
23
 
28
24
  # Get all events a legislator is a beneficiary of
29
- def parties(cid)
25
+ def parties(name)
26
+ cid = crp_id(name)
30
27
  options = {:query => {:apikey => @apikey} }
31
28
  data = HTTParty.get("http://politicalpartytime.org/api/v1/event/?beneficiaries__crp_id=" + cid.to_s + "&format=json", options)["objects"]
32
29
  return data.to_json
33
30
  end
34
31
 
35
32
  # Get a cleaner JSON of party events
36
- def parties_clean(cid)
33
+ def parties_clean(name)
34
+ cid = crp_id(name)
37
35
  parties = JSON.parse(parties(cid))
38
36
  partyarray = Array.new
39
37
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunlightpartytime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-20 00:00:00.000000000 Z
12
+ date: 2013-12-28 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Access to Sunlight Foundation's Party Time data.
15
15
  email: shidash@shidash.com