require 'nokogiri' module ShareChecker module Providers class Tweetracker < Provider # Response sample # # { # "tweets":30, # "id":"4e281dcec546612414000004", # "users":26, # "query":"http://www.mcdonaldseurokids2012.com.ua/challenges/1/works/140" # } # or # \n\n http://www.mcdonaldseurokids2012.com.ua/works/474\n 1\n 1\n 4e8f06abc546611f21000177\n\n def parse(response) doc = ::Nokogiri::XML(response) node = doc.at("users") node.nil? ? 0 : node.content.to_i end def url "http://tracktweets.aimbulance.com/api/v1/groups/#{group_id}/urls/count.xml?query=" end end end end