#cpanfile
Explore tagged Tumblr posts
x-yuri · 7 years ago
Text
facebook login
Go to All Apps
Click Add a New App
Specify Display Name, and Contact Email
Click Create App ID
Click Set Up on Facebook Login product (Dashboard)
Choose Web platform
Specify Site URL (https://localhost:4000)
Click Save
Go to Facebook Login Settings and specify Valid OAuth Redirect URI (https://localhost:4000/auth/facebook/callback)
cpanfile:
requires 'Mojolicious'; requires 'Term::ReadLine::Perl'; # perl debugger requires 'Term::ReadKey'; # perl debugger requires 'Mojolicious::Plugin::Web::Auth'; requires 'Facebook::OpenGraph'; requires 'Data::Dumper::HTML';
fb.pl:
#!/usr/bin/env perl use strict; use warnings; use utf8; use Mojolicious::Lite; use Facebook::OpenGraph; use Data::Dumper; use Data::Dumper::HTML qw(dumper_html); my $app_id = '...'; my $app_secret = '...'; my $access_token; my $fb; plugin 'Web::Auth', module => 'Facebook', key => $app_id, secret => $app_secret, on_finished => sub { my ($c, $at, $account_info) = @_; $access_token = $at; $fb = Facebook::OpenGraph->new(+{ access_token => $at, }); return $c->redirect_to( '/' ); }; get '/' => sub { my $c = shift; if ( ! $fb) { return $c->redirect_to( '/auth/facebook/authenticate' ); } my $accounts = $fb->fetch('me/accounts'); return $c->render( text => Data::Dumper->new([$accounts])->DumpHTML() ); }; app->start;
run.sh:
#!/usr/bin/env bash set -eu listen='https://*:4000?cert=./localhost.crt&key=localhost.key' carton exec morbo --listen "$listen" "$1"
$ carton $ ./run.sh fb.pl
How to make browser trust localhost SSL certificate? Graph API Explorer
0 notes
shohey1226-blog · 11 years ago
Text
Ansible playbook to install system wide Perl and its module using cpanm with cpanfile
On the other day, I posted How to install system wide perl5.18 on CentOS6.5 and I wrote an Ansible playbook to do this.
Here is the codes:
main.yml which has 2 shell scripts
Install System Perl on /opt/perl5 with plenv
Install Perl modules using cpanm with cpanfile
cpanfile
0 notes