Permalink
Browse files

Correctly handle the FollowTheMoneyResource HTTP get

FollowTheMoneyResource expects the format to be xml when
performing an HTTP get on the api.

* Changed the FollowTheMoneyResource format to xml.
* Call the body method of the HTTParty response to retrieve the XML.
  • Loading branch information...
1 parent a4c55e7 commit 20121035fff0939f6823890479e085e77a20e97b @oneacross oneacross committed Feb 14, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/gov_kit/follow_the_money.rb
@@ -8,6 +8,7 @@ module GovKit
class FollowTheMoneyResource < Resource
default_params :key => GovKit::configuration.ftm_apikey
base_uri GovKit::configuration.ftm_base_url
+ format :xml
# Common method used by subclasses to get data from the service.
#
@@ -19,7 +20,7 @@ class FollowTheMoneyResource < Resource
# doc = get_xml("/base_level.industries.list.php", :query => {:page => page_num})
#
def self.get_xml(path, options)
- doc = Nokogiri::XML(get(path, options))
+ doc = Nokogiri::XML(get(path, options).body)
e = doc.search("//error")

0 comments on commit 2012103

Please sign in to comment.