lib/skore/peerindex.rb in skore-0.0.1 vs lib/skore/peerindex.rb in skore-0.0.2
- old
+ new
@@ -6,19 +6,20 @@
class PeerIndex
##
# Include httparty module from http querys
include HTTParty
+ base_uri "https://api.peerindex.com/1/actor/topic"
default_timeout 1
-
+
attr_accessor :data
##
# Initialize and load data from kred api
def initialize(api_key, username)
begin
- @data = self.class.get("https://api.peerindex.com/1/actor/topic?twitter_screen_name=#{username}&api_key=#{api_key}")
+ @data = self.class.get("?twitter_screen_name=#{username}&api_key=#{api_key}", :verify => false)
rescue Timeout::Error
@data = false
end
end
@@ -27,10 +28,10 @@
def score
if @data
result = JSON.parse(@data.body)
result["peerindex"]
else
- 0
+ -1
end
end
end
end
\ No newline at end of file