-
-
Save phillipadsmith/91a7999ae9b9233405ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Mojo::UserAgent; | |
my $ua = Mojo::UserAgent->new; | |
$ua = $ua->max_redirects(10); | |
# This doesn't work: | |
my $r = $ua->get('http://vine.co/v/bXmx6Pth79P')->res; | |
print $r->dom->html->head->title->text; | |
# Returns: | |
# Can't locate object method "html" via package "Mojo::DOM" at /Users/phillipadsmith/Downloads/mojo_test.pl line 11. | |
# This *does* work (wtf?) | |
# perl -Mojo -E 'say g("http://vine.co/v/bXmx6Pth79P")->dom->at("title")->text' | |
# Dave Stanton's post on Vine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment