use Yammer; # Get the tokens from the command line, a config file or wherever my %tokens = ( consumer_key => 'Baj7MciMhmnDTwj6kaOV5g', consumer_secret => 'ejFlGBPtXwGJrxrEnwGvdRyokov1ncN1XxjmIm34M', callback => 'https://www.yammer.com/oauth/authorize', ); my $app = Yammer->new(%tokens); # Check to see we have a consumer key and secret unless ($app->consumer_key && $app->consumer_secret) { die "You must go get a consumer key and secret from App\n"; } # If the app is authorized (i.e has an access token and secret) # Then look at a restricted resourse if ($app->authorized) { my $response = $app->view_restricted_resource; print $response->content."\n"; exit; } # Otherwise the user needs to go get an access token and secret print "Go to " . $app->get_authorization_url( callback => 'https://www.yammer.com/oauth/authorize?rand=' . rand() ) . "\n"; print "Then hit return after\n"; ; my ($access_token, $access_token_secret) = $app->request_access_token($_);