rcullito / searchbing

gem to use the bing search api
http://rubygems.org/gems/searchbing
32 stars 12 forks source link

Parse json result with symbolized key names #2

Closed tmlee closed 11 years ago

tmlee commented 11 years ago

Thanks for the awesome gem.. and how about considering parsing the JSON result's key as a symbol instead?

rcullito commented 11 years ago

thanks for your pull request!

tmlee commented 11 years ago

:+1: Thanks for accepting! i actually forgot to update the readme, you could cherry pick it from https://github.com/tmlee/searchbing/commit/e7bc04b152fbc0164c61e1bafd68fc0817e5b217 if you like

rcullito commented 11 years ago

Thnx for considering the documentation as well. It looks like the data structure of bing's api response has changed since the last time the docs have been updated. I found something along the lines of

puts bing_results[0][:Image][0][:MediaUrl]

was needed for the first example in the readme, let me know if you found this to be different. The second seems to still work as before, after swapping out the strings with symbols.

tmlee commented 11 years ago

@rcullito cool, sorry i did not realize that. I'll look into that since i am already on it. Thx!

rcullito commented 11 years ago

@tmlee thanks for your help! just wanted to verify someone else was seeing the change also, I opened another issue for it.

rcullito commented 11 years ago

I'll probably just make the update as seen here: https://github.com/rcullito/searchbing/issues/3