diff --git a/autometal-piwik.gemspec b/autometal-piwik.gemspec index 2a6869f..74bc914 100644 --- a/autometal-piwik.gemspec +++ b/autometal-piwik.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |s| s.add_dependency('xml-simple') s.add_dependency('rest-client') - s.add_dependency('activesupport', '>= 3.0', '< 7.0') + s.add_dependency('activesupport', '>= 3.0') s.add_development_dependency('rspec', '< 3.0') s.add_development_dependency('rspec-its', '< 3.0') end diff --git a/lib/piwik/base.rb b/lib/piwik/base.rb index 5f8c9c6..2b00d1f 100644 --- a/lib/piwik/base.rb +++ b/lib/piwik/base.rb @@ -142,13 +142,13 @@ def load id def call(method, params, piwik_url=nil, auth_token=nil) params ||= {} raise MissingConfiguration, "Please edit ~/.piwik to include your piwik url and auth_key" if piwik_url.nil? || auth_token.nil? - url = "#{piwik_url}/index.php?" + url = "#{piwik_url}/index.php" params.merge!({:module => 'API', :format => 'xml', :method => method}) params.merge!({:token_auth => auth_token}) unless auth_token.nil? - url << params.to_query + # url << params.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&') verbose_obj_save = $VERBOSE $VERBOSE = nil # Suppress "warning: peer certificate won't be verified in this SSL session" - xml = RestClient.get(url) + xml = RestClient.post(url,params).body $VERBOSE = verbose_obj_save if xml.is_a?(String) && xml.force_encoding('BINARY').is_binary_data? xml.force_encoding('BINARY')