vimeo icon indicating copy to clipboard operation
vimeo copied to clipboard

can't convert String into Integer

Open acidtib opened this issue 13 years ago • 3 comments

im using Vimeo::Simple::Video.info("video_id") and i keep getting the following error

can't convert String into Integer

acidtib avatar Apr 11 '12 12:04 acidtib

I have the same problem TypeError: can't convert String into Integer from /usr/local/lib/ruby/gems/1.8/gems/httparty-0.9.0/lib/httparty/response.rb:52:in []' from /usr/local/lib/ruby/gems/1.8/gems/httparty-0.9.0/lib/httparty/response.rb:52:insend' from /usr/local/lib/ruby/gems/1.8/gems/httparty-0.9.0/lib/httparty/response.rb:52:in `method_missing' from (irb):4 Any suggestion?

prelocator avatar Oct 24 '12 07:10 prelocator

Had the same issue but believe that I've resolved it. I was trying to get info for a video like so: video = Vimeo::Simple::Video.info(video_id)

Then I was trying to get the thumbnail image: video["thumbnail_medium"]

What received instead of my thumbnail url was an error like those listed: TypeError: can't convert String into Integer

The reason? The .info method returns an array of videos (albeit with just one item in the array). Therefore, what I needed to get was the thumbnail_medium of the first item in the array: video[0]["thumbnail_medium"]

Hope that helps anyone else having a problem.

neilsmind avatar Nov 29 '12 14:11 neilsmind

working perfectly, thank you so much neilsmind!

prelocator avatar Nov 29 '12 18:11 prelocator