Skip to content

Instantly share code, notes, and snippets.

@jfeldstein
Created December 5, 2012 18:35
Show Gist options
  • Save jfeldstein/4218255 to your computer and use it in GitHub Desktop.
Save jfeldstein/4218255 to your computer and use it in GitHub Desktop.
Happened the first but not the second time:
1.9.2-p320 :034 > resp = api.get_order 'JJOI11M7LN'
MultiJson::DecodeError: 757: unexpected token at '<script type="text/javascript" src="https://sealserver.trustwave.com/seal.js?style=invert&size=65x36&code=55ad3fdf8f8f4a928e1c73ca8049d95d"></script>
{"id":"JJOI11M7LN","order_status":"approved","start_time":"2012-11-29 00:00:00","end_time":"2013-01-13 00:00:00","package_id":"LDWROVFINC","price":1275,"client":"Philly.com","Campaigns":[{"type":"cpm","delivery_status":"running","zone_id":"CUVM0V2AGW","website_id":"8E362LINC7","website_name":"NewsWorks","website_url":"http:\/\/www.newsworks.org\/","impressions":102000}],"FrequencyCapping":{"views":5,"period":24,"period_unit":"hour","id":"FC5_24H"},"GeoTargeting":[{"id":"GEOUS","description":"Includes all 50 states"}]}'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/json-1.7.5/lib/json/common.rb:155:in `parse'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/json-1.7.5/lib/json/common.rb:155:in `parse'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/multi_json-1.3.6/lib/multi_json/adapters/json_common.rb:7:in `load'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/multi_json-1.3.6/lib/multi_json.rb:93:in `load'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/httparty-0.9.0/lib/httparty/parser.rb:117:in `json'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/httparty-0.9.0/lib/httparty/parser.rb:140:in `parse_supported_format'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/httparty-0.9.0/lib/httparty/parser.rb:102:in `parse'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/httparty-0.9.0/lib/httparty/parser.rb:66:in `call'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/httparty-0.9.0/lib/httparty/request.rb:204:in `parse_response'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/httparty-0.9.0/lib/httparty/request.rb:174:in `block in handle_response'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/httparty-0.9.0/lib/httparty/response.rb:18:in `call'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/httparty-0.9.0/lib/httparty/response.rb:18:in `parsed_response'
from /Users/jordan_isocket/Development/buyadspro/lib/buyads/http/httparty_client.rb:22:in `last_request_was_successful'
from /Users/jordan_isocket/Development/buyadspro/lib/buyads/http/httparty_client.rb:74:in `do_request'
from /Users/jordan_isocket/Development/buyadspro/lib/buyads/http/httparty_client.rb:26:in `get'
from /Users/jordan_isocket/Development/buyadspro/lib/buyads/client.rb:69:in `get_order'
from /Users/jordan_isocket/Development/buyadspro/lib/buyads/privileged/oop_client.rb:34:in `get_order'
from (irb):34
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'1.9.2-p320 :035 > resp = api.get_order 'JJOI11M7LN'
=> #<Buyads::Response::Base:0x007fd26f591520 @response={"id"=>"JJOI11M7LN", "order_status"=>"approved", "start_time"=>"2012-11-29 00:00:00", "end_time"=>"2013-01-13 00:00:00", "package_id"=>"LDWROVFINC", "price"=>1275, "client"=>"Philly.com", "Campaigns"=>[{"type"=>"cpm", "delivery_status"=>"running", "zone_id"=>"CUVM0V2AGW", "website_id"=>"8E362LINC7", "website_name"=>"NewsWorks", "website_url"=>"http://www.newsworks.org/", "impressions"=>102000}], "FrequencyCapping"=>{"views"=>5, "period"=>24, "period_unit"=>"hour", "id"=>"FC5_24H"}, "GeoTargeting"=>[{"id"=>"GEOUS", "description"=>"Includes all 50 states"}]}>
1.9.2-p320 :036 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment