Skip to content

Instantly share code, notes, and snippets.

@pjf
Created January 22, 2014 12:24
Show Gist options
  • Save pjf/8557856 to your computer and use it in GitHub Desktop.
Save pjf/8557856 to your computer and use it in GitHub Desktop.
Rickroll cmdline utility
#!/usr/bin/perl -w
use 5.010;
use strict;
use warnings;
use autodie;
use WWW::Twilio::API;
my $lucky_person = shift || die "Usage: $0 phone-number";
my $rick = WWW::Twilio::API->new(
AccountSid => 'Your Account SID',
AuthToken => 'Your Auth Token',
);
my $response = $rick->POST( 'Calls',
From => 'Your Rickroll Number',
To => $lucky_person,
Url => 'Your Rickroll Server',
);
say $response->{content};
@pjf
Copy link
Author

pjf commented Jan 22, 2014

Your RickRoll server only needs to return the following response:

<?xml version="1.0" encoding="UTF-8" ?>
<Response><Play loop="1">https://dl.dropboxusercontent.com/u/9702672/music/01-NeverGonnaGiveYouUp.mp3</Play></Response>

(You can play Rick Astley from another location if you like.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment