lib/share_checker/providers/twitter.rb in share_checker-0.1.0 vs lib/share_checker/providers/twitter.rb in share_checker-0.1.1
- old
+ new
@@ -1,6 +1,6 @@
-require 'json'
+require 'crack/json'
module ShareChecker
module Providers
class Twitter < Provider
@@ -8,10 +8,10 @@
#
# twttr.receiveCount({"count":38,"url":"http://www.mcdonaldseurokids2012.com.ua/challenges/1/works/98/"})
#
def parse(response)
if response =~ /^twttr.receiveCount\((.+)\)$/i
- obj = JSON.parse($1)
+ obj = Crack::JSON.parse($1)
obj["count"].to_i
end
end
def url