#!perl use strict; use warnings; use Digest::HMAC_SHA1; use Data::Dump qw /dump/; use URI::Escape; use Net::OAuth; use Net::OAuth::RequestTokenRequest; use MIME::Base64; use LWP::UserAgent; # Authorize a user my $consumer_key = "586a3643bbc31e113205ab62afd86689"; my $secret = "1ff16d3829274918"; my $method = "vimeo.videos.search" ; my $oauth_nonce = int( rand( 2**32 ) ) ; my $timestamp = time ; my $query = "happy" ; my $url = "http://vimeo.com/oauth/request_token"; my $request = Net::OAuth::RequestTokenRequest->new( consumer_key => $consumer_key, consumer_secret => $secret, request_url => $url, request_method => 'GET', signature_method => 'HMAC-SHA1', timestamp => $timestamp, nonce => $oauth_nonce, ); die "COULDN'T GET REQUEST SIGN! Check parameters.\n" unless $request->sign; die "COULDN'T VERIFY! Check OAuth parameters.\n" unless $request->verify; my $browser = LWP::UserAgent->new; my $post_body = $request->to_post_body; $post_body = "oauth_callback=oob&" . $post_body; my $post_url = $url . '/?' . $post_body; my $res = $browser->get( $post_url ); die $res->status_line unless ($res->is_success); print $res->content;