Skip to content

Commit

Permalink
slightly better Mojo::UserAgent examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 16, 2013
1 parent e40b6f7 commit a7d77d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -495,13 +495,13 @@ Mojo::UserAgent - Non-blocking I/O HTTP and WebSocket user agent
# Quick JSON API request with Basic authentication
say $ua->get('https://sri:s3cret@example.com/search.json?q=perl')
->res->json('/results/0');
->res->json('/results/0/title');
# Extract data from HTML and XML resources
say $ua->get('www.perl.org')->res->dom->html->head->title->text;
# Scrape information from websites
say $ua->get('mojolicio.us')->res->dom('h1, h2')->pluck('text')->shuffle;
# Scrape the latest headlines from a news site
say $ua->get('perlnews.org')->res->dom('h2 > a')->pluck('text')->shuffle;
# IPv6 PUT request with content
my $tx
Expand Down

0 comments on commit a7d77d5

Please sign in to comment.