Here’s a little Rails code snippet, posted here for posterity or until Vimeo changes their developer API. The code simply retrieves a JSON details object for a given video. Enjoy. . .
VIMEO_URL_REGEX = /(www.)?vimeo\.com.*?\/(\d+?)$/
url = "http://www.vimeo.com/2233379"
begin
if VIMEO_REGEX.match(url)
vid_id = VIMEO_URL_REGEX.match(url)[2]
vimeo_url = "http://vimeo.com/api/v2/video/#{vid_id}.json"
response = Net::HTTP.get_response(URI.parse(vimeo_url))
results = JSON.parse(response.body)[0]
@description = results["description"]
@thumbnail_url = results["thumbnail_small"]
end
rescue Exception => exc
# DNS failed...
end
