RaVbaker/flickr — pull request #1 by koepalex (2014-01-09 23:29:47+00:00)
Title: second instead of first key-value pair at flickr search APIs HTTP/XML re...

Hello,
I've written a simple ruby script to search pictures at flickr using the gem 'flickr' but it doesn't work.

## script
`require 'flickr'
flickr = Flickr.new('api_key')
photos = flickr..photos_search( {"text" => "nature"})`

## observation
It only return an empty array. But within Wireshark I saw and HTTP/XML response with code 200 OK and the xml contains all relevant data.

## analysis
While debugging I found the problem within initialize of PhotoCollection class:
The comment pointed out that photos_api_response contains only one value. But within the debugger I saw at least two:
*(rdb:1) p photos_api_response.values
[__"ok"__ , {"page"=>"1", "pages"=>"177532", "perpage"=>"100", "total"=>"17753144", "photo"=>[{*

## solution
Using the second element of response instead of the first.

## tests
Without changes:
*Finished tests in 0.078471s, 1325.3304 tests/s, 2612.4301 assertions/s.
104 tests, 205 assertions, 1 failures, 15 errors, 0 skips*
With changes:
*Finished tests in 0.076112s, 1366.4074 tests/s, 2693.3992 assertions/s.
104 tests, 205 assertions, 1 failures, 15 errors, 0 skips*