Created
September 6, 2010 09:33
-
-
Save toto/566839 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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