3 ms·
For Perl, I've mentioned this elsewhere here but Mojo::UserAgent looks quite neat. This time with Mojolicious url - http://mojolicio.us/perldoc/Mojo/UserAgent
by draegtun 15y ago
For Perl, I've mentioned this elsewhere here but Mojo::UserAgent looks quite neat. This time with Mojolicious url - http://mojolicio.us/perldoc/Mojo/UserAgent http://mojolicio.us/perldoc/Mojo/UserAgent
- kgtm 15y agoInteresting things can happen with M::UA in a single line: use Mojo::UserAgent; print Mojo::UserAgent->new->get('http://freegeoip.net/json/8.8.8.8')->res->json->{country_name}; Very powerful.
- draegtun 15y agoIndeed. And there are many more nice examples in the cookbook: http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#USER_AGENT http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#USER... Also check out the command line interface which allows you todo things like this: $ mojo get http://mojolicio.us 'head > title' ref: http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Command_line http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Comm...