ROTFL.
Banale installazione attraverso CPAN e local::lib di un framework da provare: Mojolicious.
[…]
Fetching with LWP:
http://www.perl.org/CPAN/authors/id/K/KR/KRAIH/Mojolicious-1.33.tar.gz
[…]
Installing /home/sim/perl5/lib/perl5/ojo.pm
Installing /home/sim/perl5/lib/perl5/Mojo.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious.pm
Installing /home/sim/perl5/lib/perl5/README.pod
Installing /home/sim/perl5/lib/perl5/Mojo/Date.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Cookie.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Message.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Command.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Content.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Asset.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Cache.pm
Installing /home/sim/perl5/lib/perl5/Mojo/JSON.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Upload.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Server.pm
Installing /home/sim/perl5/lib/perl5/Mojo/CookieJar.pm
Installing /home/sim/perl5/lib/perl5/Mojo/DOM.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Util.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Home.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Exception.pm
Installing /home/sim/perl5/lib/perl5/Mojo/IOLoop.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Client.pm
Installing /home/sim/perl5/lib/perl5/Mojo/URL.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Base.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Loader.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Log.pm
Installing /home/sim/perl5/lib/perl5/Mojo/ByteStream.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Headers.pm
Installing /home/sim/perl5/lib/perl5/Mojo/HelloWorld.pm
Installing /home/sim/perl5/lib/perl5/Mojo/UserAgent.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Transaction.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Template.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Path.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Parameters.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Cookie/Response.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Cookie/Request.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Server/CGI.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Server/PSGI.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Server/Daemon.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Server/FastCGI.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Server/Hypnotoad.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Transaction/WebSocket.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Transaction/HTTP.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Asset/Memory.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Asset/File.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Message/Response.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Message/Request.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Content/Single.pm
Installing /home/sim/perl5/lib/perl5/Mojo/Content/MultiPart.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugins.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Commands.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Static.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Controller.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Lite.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Renderer.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Routes.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Types.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Sessions.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Guides.pod
Installing /home/sim/perl5/lib/perl5/Mojolicious/Routes/Pattern.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Routes/Match.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/EpRenderer.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/TagHelpers.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/I18n.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/PoweredBy.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/PodRenderer.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/EplRenderer.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/DefaultHelpers.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/AgentCondition.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/Charset.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/Config.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/RequestTimer.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/JsonConfig.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Plugin/HeaderCondition.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/favicon.ico
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/failraptor.png
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/mojolicious-black.png
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/mojolicious-noraptor.png
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/mojolicious-white.png
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/mojolicious-pinstripe.gif
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/mojolicious-clouds.png
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/mojolicious-notfound.png
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/amelia.png
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/mojolicious-arrow.png
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/mojolicious-box.png
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/css/prettify.css
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/css/prettify-mojo.css
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-ml.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-hs.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-vb.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-sql.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-css.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-vhdl.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/jquery.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-scala.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-wiki.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-proto.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-lisp.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/prettify.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-apollo.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-lua.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/public/js/lang-yaml.js
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Fastcgi.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Routes.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Cgi.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Generate.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Get.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Daemon.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Test.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Inflate.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Psgi.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Version.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Generate/LiteApp.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Generate/Makefile.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Generate/Gitignore.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Generate/App.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Command/Generate/Hypnotoad.pm
Installing /home/sim/perl5/lib/perl5/Mojolicious/Guides/Cheatsheet.pod
Installing /home/sim/perl5/lib/perl5/Mojolicious/Guides/Cookbook.pod
Installing /home/sim/perl5/lib/perl5/Mojolicious/Guides/Growing.pod
Installing /home/sim/perl5/lib/perl5/Mojolicious/Guides/Rendering.pod
Installing /home/sim/perl5/lib/perl5/Mojolicious/Guides/FAQ.pod
Installing /home/sim/perl5/lib/perl5/Mojolicious/Guides/CodingGuidelines.pod
Installing /home/sim/perl5/lib/perl5/Mojolicious/Guides/Routing.pod
Installing /home/sim/perl5/lib/perl5/Mojolicious/templates/mojobar.html.ep
Installing /home/sim/perl5/lib/perl5/Mojolicious/templates/perldoc.html.ep
Installing /home/sim/perl5/lib/perl5/Mojolicious/templates/exception.development.html.ep
Installing /home/sim/perl5/lib/perl5/Mojolicious/templates/not_found.development.html.ep
Installing /home/sim/perl5/lib/perl5/Mojolicious/templates/not_found.html.ep
Installing /home/sim/perl5/lib/perl5/Mojolicious/templates/exception.html.ep
Installing /home/sim/perl5/lib/perl5/Test/Mojo.pm
Installing /home/sim/perl5/man/man1/hypnotoad.1p
Installing /home/sim/perl5/man/man1/mojo.1p
Installing /home/sim/perl5/man/man3/Mojolicious::Guides::Cheatsheet.3pm
Installing /home/sim/perl5/man/man3/Mojo::Template.3pm
Installing /home/sim/perl5/man/man3/Mojo::Server::CGI.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Generate.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Sessions.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Generate::Gitignore.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Psgi.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::I18n.3pm
Installing /home/sim/perl5/man/man3/Mojo.3pm
Installing /home/sim/perl5/man/man3/Mojo::Transaction::WebSocket.3pm
Installing /home/sim/perl5/man/man3/ojo.3pm
Installing /home/sim/perl5/man/man3/Mojo::Util.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Renderer.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Controller.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Daemon.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin.3pm
Installing /home/sim/perl5/man/man3/Mojo::IOLoop.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Generate::App.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Test.3pm
Installing /home/sim/perl5/man/man3/Mojo::Content::Single.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::JsonConfig.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Guides::Routing.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::RequestTimer.3pm
Installing /home/sim/perl5/man/man3/Mojo::Transaction::HTTP.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Guides::Cookbook.3pm
Installing /home/sim/perl5/man/man3/Mojo::Loader.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Static.3pm
Installing /home/sim/perl5/man/man3/Mojo::Server::FastCGI.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Routes::Match.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Version.3pm
Installing /home/sim/perl5/man/man3/Mojo::ByteStream.3pm
Installing /home/sim/perl5/man/man3/Mojo::Exception.3pm
Installing /home/sim/perl5/man/man3/Mojo::Message.3pm
Installing /home/sim/perl5/man/man3/Mojo::Cookie.3pm
Installing /home/sim/perl5/man/man3/Mojo::Cache.3pm
Installing /home/sim/perl5/man/man3/Mojo::Message::Request.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::Charset.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::HeaderCondition.3pm
Installing /home/sim/perl5/man/man3/README.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Generate::LiteApp.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::EplRenderer.3pm
Installing /home/sim/perl5/man/man3/Mojo::URL.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Generate::Hypnotoad.3pm
Installing /home/sim/perl5/man/man3/Mojo::Message::Response.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Inflate.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::PodRenderer.3pm
Installing /home/sim/perl5/man/man3/Mojo::Upload.3pm
Installing /home/sim/perl5/man/man3/Mojo::Server.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::EpRenderer.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Get.3pm
Installing /home/sim/perl5/man/man3/Mojo::Path.3pm
Installing /home/sim/perl5/man/man3/Mojo::Date.3pm
Installing /home/sim/perl5/man/man3/Mojolicious.3pm
Installing /home/sim/perl5/man/man3/Mojo::Headers.3pm
Installing /home/sim/perl5/man/man3/Mojo::Asset::File.3pm
Installing /home/sim/perl5/man/man3/Mojo::Base.3pm
Installing /home/sim/perl5/man/man3/Mojo::HelloWorld.3pm
Installing /home/sim/perl5/man/man3/Mojo::Transaction.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::AgentCondition.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Lite.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Commands.3pm
Installing /home/sim/perl5/man/man3/Mojo::UserAgent.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Routes::Pattern.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Routes.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Generate::Makefile.3pm
Installing /home/sim/perl5/man/man3/Mojo::Server::Hypnotoad.3pm
Installing /home/sim/perl5/man/man3/Mojo::Client.3pm
Installing /home/sim/perl5/man/man3/Mojo::Log.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Types.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::TagHelpers.3pm
Installing /home/sim/perl5/man/man3/Mojo::Cookie::Response.3pm
Installing /home/sim/perl5/man/man3/Mojo::DOM.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Guides.3pm
Installing /home/sim/perl5/man/man3/Test::Mojo.3pm
Installing /home/sim/perl5/man/man3/Mojo::Asset::Memory.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::Config.3pm
Installing /home/sim/perl5/man/man3/Mojo::JSON.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::DefaultHelpers.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Fastcgi.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Routes.3pm
Installing /home/sim/perl5/man/man3/Mojo::Home.3pm
Installing /home/sim/perl5/man/man3/Mojo::Cookie::Request.3pm
Installing /home/sim/perl5/man/man3/Mojo::Server::Daemon.3pm
Installing /home/sim/perl5/man/man3/Mojo::CookieJar.3pm
Installing /home/sim/perl5/man/man3/Mojo::Content.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugin::PoweredBy.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Guides::Growing.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Guides::FAQ.3pm
Installing /home/sim/perl5/man/man3/Mojo::Content::MultiPart.3pm
Installing /home/sim/perl5/man/man3/Mojo::Server::PSGI.3pm
Installing /home/sim/perl5/man/man3/Mojo::Asset.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Plugins.3pm
Installing /home/sim/perl5/man/man3/Mojo::Command.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Command::Cgi.3pm
Installing /home/sim/perl5/man/man3/Mojo::Parameters.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Guides::CodingGuidelines.3pm
Installing /home/sim/perl5/man/man3/Mojolicious::Guides::Rendering.3pm
Installing /home/sim/perl5/bin/hypnotoad
Installing /home/sim/perl5/bin/mojo
Appending installation info to /home/sim/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/perllocal.pod
KRAIH/Mojolicious-1.33.tar.gz
/usr/bin/make install – OK
Patchare progetti pubblici è un grande aiuto per l’autostima.
Mi sono emozionato.
12:16 < trone> sri: script/app routes show the app's routes.
Could be useful to show also the method (via)
used by the specific route?
13:14 <@marcus> trone: patches welcome?
13:14 <+purl> patches welcome is always true or unless for
search.cpan.org or swahili for "Put up or shut up."
13:56 < trone> marcus: sure.
If it can to be useful, I'll do -
if I understand how.
Just asking if could to be interesting
14:20 <@marcus> trone: it seems useful to me
19:18 < Akron> trone: Nice patch!
19:23 < GitHub140> mojo: master sim * 35fb3fe (1 files in 1 dirs):
Add HTTP methods in script routes output
19:23 < GitHub140> mojo: master Sebastian Riedel * 296458e (1 files
in 1 dirs): Merge pull request #149 from
simotrone/master ...
19:23 < GitHub140> mojo: master commits 10efa91...296458e -
http://bit.ly/mRnh8A
19:26 <@yko> trone++ 19:27 * yko updated and tested
19:55 <@sri> trone++
Che oggetto incredibile. Avevo visto un talk a riguardo a YAPC 2010, e finalmente ho avuto il tempo di provare…
Meccanizzare firefox? Si può.
MozRepl
Un filmato: MozRepl.
Attraverso il plugin MozRepl si rende firefox un server sfruttabile attraverso una console. La console è utilizzabile direttamente via telnet/nc, oppure attraverso delle interfacce.
MozRepl va installato sotto le estensioni di firefox e lanciato da Tools.
Welcome to MozRepl.
- If you get stuck at the "…>" prompt, enter a semicolon (;) at the beginning of the line to force evaluation.
- If you get errors after every character you type, see http://github.com/bard/mozrepl/wikis/troubleshooting (short version: stop using Microsoft telnet, use netcat or putty instead)
Current working context: chrome://browser/content/browser.xul
Current input mode: syntax
repl> repl.whereAmI();
[object ChromeWindow] – Document title: "Add New Post 9 SIMOTRONE WEB PAGE WordPress – Iceweasel"
Altre menate le si vede nel tutorial, con repl.look(); e repl.doc(repl.funzione); da console.
Ah, alla fine di tutto…
Comunque, esperimenti minchioni a parte, il punto è automatizzare con Perl e Mechanize qualunque attività ripetitiva venga fatta col browser. Datemi qualche giorno.
Un problema che vedo porre spesso è come inserire un file in una variabile scalare.
In Perl infatti, la procedura “standard” porta spesso i novizi a non ottenere quello che vogliono:
(Esempio presto da stack overflow. Sic, non ci sono i my per definire lo scope.
)
In $document andrà a finire solo la prima riga di index.html.
Un modo per ottenere il tutto sarebbe questo (print prende una lista di argomenti):
Cercavo un modo più idiomatico, e nello stesso thread lo trova jrockway…
Bello.
Di GS se ne vedono parecchi in giro; pure troppi.
Del resto “san far tutto”, dicono.
