App-WatchLater

 view release on metacpan or  search on metacpan

bin/yt-oauth  view on Meta::CPAN


  # setup a pipe and fork
  if (open my $fh, '-|') {
    # parent
    return ($port, $fh);
  } else {
    # child
    listen $sock, SOMAXCONN;
    accept(my $client, $sock);

    # response displayed to user after credentials are obtained
    $client->autoflush(1);
    print $client qq(HTTP/1.1 200 OK\r\n);
    print $client qq(Content-Language: en-US\r\n);
    print $client qq(Content-Type: text/html\r\n);
    print $client qq(\r\n);
    print $client qq(<html lang="en"><body>\r\n);
    print $client qq(Successfully obtained OAuth credentials.\r\n);
    print $client qq(This page may be closed.\r\n);
    print $client qq(</body></html>);

    # print credentials to pipe
    my $response = <$client>;
    print $response;
    exit;
  }
}

sub authenticate {
  my ($port, $fh) = start_http_listener;

  my $oauth_url = OAUTH_URL_TEMPLATE;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.041 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )