Skip to content

Instantly share code, notes, and snippets.

@toto
Created September 6, 2010 09:33
Show Gist options
  • Save toto/566839 to your computer and use it in GitHub Desktop.
Save toto/566839 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'pp'
require 'json'
require 'httparty'
url = "http://www.adgonline.de/adg_online/phoenix/searchalyzr.jspx"
class Loader
include HTTParty
end
json_params = {"categoryStates" => [],
"columns" => [],
'searchQuery' => {"parameterAssignments"=> [],
"terms"=> ["Manag"],
"limit"=> 10},
"vrbSessionId"=> {"sid"=> "", "uid"=> ""}}
headers = {'X-RequestedWith' => 'XmlHttpRequest'}
query = {'aktion' => 'getSearchResult',
'searchParams' => json_params.to_json,
'searchSystemType' => 'ionas3_adg',
'searchSystemUrl' => '_:'}
result = Loader.post(url, :query => query, :headers => headers)
puts result.body
# what's wrong with the json?
data = JSON.parse(result.body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment