Enviar pesquisa
Carregar
Mojo as a_client
•
Transferir como KEY, PDF
•
12 gostaram
•
1,651 visualizações
Marcus Ramberg
Seguir
Showing how to use mojo as the next LWP
Leia menos
Leia mais
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 52
Baixar agora
Recomendados
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101
hendrikvb
Perl web frameworks
Perl web frameworks
diego_k
Webrtc mojo
Webrtc mojo
bpmedley
Inside Bokete: Web Application with Mojolicious and others
Inside Bokete: Web Application with Mojolicious and others
Yusuke Wada
Developing apps using Perl
Developing apps using Perl
Anatoly Sharifulin
RESTful web services
RESTful web services
Tudor Constantin
Asynchronous programming patterns in Perl
Asynchronous programming patterns in Perl
deepfountainconsulting
Mojolicious
Mojolicious
Marcos Rebelo
Recomendados
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101
hendrikvb
Perl web frameworks
Perl web frameworks
diego_k
Webrtc mojo
Webrtc mojo
bpmedley
Inside Bokete: Web Application with Mojolicious and others
Inside Bokete: Web Application with Mojolicious and others
Yusuke Wada
Developing apps using Perl
Developing apps using Perl
Anatoly Sharifulin
RESTful web services
RESTful web services
Tudor Constantin
Asynchronous programming patterns in Perl
Asynchronous programming patterns in Perl
deepfountainconsulting
Mojolicious
Mojolicious
Marcos Rebelo
Mojolicious - A new hope
Mojolicious - A new hope
Marcus Ramberg
Perl: Hate it for the Right Reasons
Perl: Hate it for the Right Reasons
Matt Follett
Keeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro framework
Jeremy Kendall
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
Anatoly Sharifulin
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro framework
Jeremy Kendall
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Dotan Dimet
Mojolicious: what works and what doesn't
Mojolicious: what works and what doesn't
Cosimo Streppone
Slim RedBeanPHP and Knockout
Slim RedBeanPHP and Knockout
Vic Metcalfe
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7
Masahiro Nagano
YAPC::Asia 2010 Twitter解析サービス
YAPC::Asia 2010 Twitter解析サービス
Yusuke Wada
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Arc & Codementor
Asynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time Messaging
Steve Rhoades
Mojolicious on Steroids
Mojolicious on Steroids
Tudor Constantin
Any event intro
Any event intro
qiang
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time web
clkao
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
Wallace Reis
Blog Hacks 2011
Blog Hacks 2011
Yusuke Wada
Mojolicious, real-time web framework
Mojolicious, real-time web framework
taggg
エロサイト管理者の憂鬱3 - Hokkaiodo.pm#4 -
エロサイト管理者の憂鬱3 - Hokkaiodo.pm#4 -
Yusuke Wada
PHP5.5 is Here
PHP5.5 is Here
julien pauli
TELEMEDICINE OUR VISION TO FUTURE
TELEMEDICINE OUR VISION TO FUTURE
Society for Microbiology and Infection care
Expresiones Regulares
Expresiones Regulares
Kar Juan
Mais conteúdo relacionado
Mais procurados
Mojolicious - A new hope
Mojolicious - A new hope
Marcus Ramberg
Perl: Hate it for the Right Reasons
Perl: Hate it for the Right Reasons
Matt Follett
Keeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro framework
Jeremy Kendall
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
Anatoly Sharifulin
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro framework
Jeremy Kendall
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Dotan Dimet
Mojolicious: what works and what doesn't
Mojolicious: what works and what doesn't
Cosimo Streppone
Slim RedBeanPHP and Knockout
Slim RedBeanPHP and Knockout
Vic Metcalfe
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7
Masahiro Nagano
YAPC::Asia 2010 Twitter解析サービス
YAPC::Asia 2010 Twitter解析サービス
Yusuke Wada
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Arc & Codementor
Asynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time Messaging
Steve Rhoades
Mojolicious on Steroids
Mojolicious on Steroids
Tudor Constantin
Any event intro
Any event intro
qiang
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time web
clkao
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
Wallace Reis
Blog Hacks 2011
Blog Hacks 2011
Yusuke Wada
Mojolicious, real-time web framework
Mojolicious, real-time web framework
taggg
エロサイト管理者の憂鬱3 - Hokkaiodo.pm#4 -
エロサイト管理者の憂鬱3 - Hokkaiodo.pm#4 -
Yusuke Wada
PHP5.5 is Here
PHP5.5 is Here
julien pauli
Mais procurados
(20)
Mojolicious - A new hope
Mojolicious - A new hope
Perl: Hate it for the Right Reasons
Perl: Hate it for the Right Reasons
Keeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro framework
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro framework
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Mojolicious: what works and what doesn't
Mojolicious: what works and what doesn't
Slim RedBeanPHP and Knockout
Slim RedBeanPHP and Knockout
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7
YAPC::Asia 2010 Twitter解析サービス
YAPC::Asia 2010 Twitter解析サービス
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Asynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time Messaging
Mojolicious on Steroids
Mojolicious on Steroids
Any event intro
Any event intro
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
Blog Hacks 2011
Blog Hacks 2011
Mojolicious, real-time web framework
Mojolicious, real-time web framework
エロサイト管理者の憂鬱3 - Hokkaiodo.pm#4 -
エロサイト管理者の憂鬱3 - Hokkaiodo.pm#4 -
PHP5.5 is Here
PHP5.5 is Here
Destaque
TELEMEDICINE OUR VISION TO FUTURE
TELEMEDICINE OUR VISION TO FUTURE
Society for Microbiology and Infection care
Expresiones Regulares
Expresiones Regulares
Kar Juan
Curscatalyst
Curscatalyst
Kar Juan
andUNITE search groups - how to
andUNITE search groups - how to
andUNITE
A First Class Web Citizen
A First Class Web Citizen
Gareth Rushgrove
Blogging In The Library Revised Oct 16
Blogging In The Library Revised Oct 16
bhodes
Mojolicious
Mojolicious
Marcus Ramberg
Destaque
(7)
TELEMEDICINE OUR VISION TO FUTURE
TELEMEDICINE OUR VISION TO FUTURE
Expresiones Regulares
Expresiones Regulares
Curscatalyst
Curscatalyst
andUNITE search groups - how to
andUNITE search groups - how to
A First Class Web Citizen
A First Class Web Citizen
Blogging In The Library Revised Oct 16
Blogging In The Library Revised Oct 16
Mojolicious
Mojolicious
Semelhante a Mojo as a_client
The promise of asynchronous php
The promise of asynchronous php
Wim Godden
Tatsumaki
Tatsumaki
Tatsuhiko Miyagawa
The promise of asynchronous php
The promise of asynchronous php
Wim Godden
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.
Workhorse Computing
Plack - LPW 2009
Plack - LPW 2009
Tatsuhiko Miyagawa
PSGI and Plack from first principles
PSGI and Plack from first principles
Perl Careers
Psgi Plack Sfpm
Psgi Plack Sfpm
som_nangia
Psgi Plack Sfpm
Psgi Plack Sfpm
wilburlo
React PHP: the NodeJS challenger
React PHP: the NodeJS challenger
vanphp
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges
✅ William Pinaud
The promise of asynchronous PHP
The promise of asynchronous PHP
Wim Godden
How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server
Masahiro Nagano
Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!
Kacper Gunia
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time web
clkao
The promise of asynchronous PHP
The promise of asynchronous PHP
Wim Godden
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
Ian Barber
Web 8 | Introduction to PHP
Web 8 | Introduction to PHP
Mohammad Imam Hossain
Forget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers Cracow
Kacper Gunia
Dirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP Extension
Adam Trachtenberg
Semelhante a Mojo as a_client
(20)
The promise of asynchronous php
The promise of asynchronous php
Tatsumaki
Tatsumaki
The promise of asynchronous php
The promise of asynchronous php
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.
Plack - LPW 2009
Plack - LPW 2009
PSGI and Plack from first principles
PSGI and Plack from first principles
Psgi Plack Sfpm
Psgi Plack Sfpm
Psgi Plack Sfpm
Psgi Plack Sfpm
React PHP: the NodeJS challenger
React PHP: the NodeJS challenger
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges
The promise of asynchronous PHP
The promise of asynchronous PHP
How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server
Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time web
The promise of asynchronous PHP
The promise of asynchronous PHP
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
Web 8 | Introduction to PHP
Web 8 | Introduction to PHP
Forget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers Cracow
Dirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP Extension
Último
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
johnbeverley2021
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
apidays
presentation ICT roal in 21st century education
presentation ICT roal in 21st century education
jfdjdjcjdnsjd
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Rustici Software
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
apidays
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Zilliz
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
apidays
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Edi Saputra
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Zilliz
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Andrey Devyatkin
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
Sandro Moreira
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Nanddeep Nachan
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
apidays
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
MadyBayot
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
Zilliz
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Juan lago vázquez
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
WSO2
Último
(20)
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
presentation ICT roal in 21st century education
presentation ICT roal in 21st century education
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
Mojo as a_client
1.
Mojo as a
HTTP A new beginning
2.
I am Marcus
I work here
3.
In the beginning
there was LWP
4.
First Changelog Entry: Thu
18 May 1995 Martijn Koster <m.koster@nexor.co.uk> o Mentioned on libwww-perl that I had changed the classes around lots.
5.
Became wildly popular,
default choice for HTTP in Perl.
6.
Starting to show it’s
age
7.
Clunky API
No Async No Web Socket ...
8.
The time is
ripe for a new beginning.
9.
perl -Mojo -e' g("vg.no/") ->dom(".article-content
h3 a") ->each(sub { b(shift->text) ->decode->say })'
10.
Actually, it didn’t happen
just like that.
11.
Sebastian Riedel
@kraih
12.
Took over Maypole.
Wanted to make radical changes
13.
Got Booted
14.
Created Catalyst. Wanted to
make radical changes
15.
Got Booted
16.
Made Mojolicious.
Wanted to target PHP developers & Perl 6
17.
Ease of install/porting
➜ Only Perl5 core dependencies
18.
Bootstrapping: curl -L
cpanmin.us | sudo perl - Mojolicious
19.
Wrote an async
HTTP 1.1 compliant stack
20.
Mojo::Transaction Mojo::Message::Response
Mojo::Cookie Mojo::URL +++
21.
Test Driven Development
22.
RFC Driven Development
23.
PRAGMATIC
24.
Next logical step: Add
a client on top of this stack.
25.
Mojo == Lego Built
from reusable bricks.
26.
Parallel requests
27.
my $callback =
sub { print shift−>res−>body }; $client−>get('http://mojolicious.org' => $callback); $client−>get('http://search.cpan.org' => $callback); $client−>start;
28.
Form Handling
29.
# Form post
with exception handling my $cpan = 'http://search.cpan.org/search'; my $search = {q => 'mojo'}; my $tx = $client−>post_form($cpan => $search); if (my $res = $tx−>success) { print $res−>body } else { my ($message, $code) = $tx−>error; print "Error: $message"; }
30.
Web Sockets
31.
$client−>websocket( 'ws://websockets.org:8787' => sub {
my $client = shift; $client−>on_message( sub { my ($client, $message) = @_; print "$messagen"; $client−>finish; }); $client−>send_message('hiya!'); })−>start;
32.
Oneliners
33.
Collection of single
letter commands.
34.
g ➜ get
d ➜ delete f ➜ form post p ➜ post u ➜ put w ➜ websocket
35.
Special Cases b ➜
byte stream, a ➜ Lite app
36.
#ojo module my $res
= g( 'http://mojolicio.us', {'Content−Type' => 'text/plain'}, 'Hello!' ); perl -Mojo -e 'b(g("mojolicio.us")->dom->at("title")->text)->say' perl -Mojo -E'g("bloomberg.com")->dom("a.story_link")->each(sub { say shift->text; })' perl -Mojo -E'g("digg.com")->dom("a.story-title")->each(sub { say pop, ". ", shift->text })' # Undocumented o(fun) Mojolicious cloud function: perl -Mojo -e 'oO("http://www.reddit.com")->dom->find("a.title")- >each(sub { Oo(pop . ". " . shift->text)->say })'
37.
Mojo::DOM
38.
Liberal XML Parser
39.
Supports all CSS3
selectors that make sense
40.
* E[foo=”bar”]
E:checked E:empty E:nth-child E:first-of-type E:not(s) EF E>F ++++
41.
o(fun) If you need
performance use libXML
42.
SOME RANDOM
BITS
43.
Supports IPV6, TLS,proxies, epoll,
kqueue
44.
DEBUG MODE
ENV VARIABLE MOJO_CLIENT_DEBUG=1 perl -Mojo -E’...’
45.
# Streaming response my
$tx = $client−>build_tx(GET => 'http://mojolicious.org'); $tx−>res−>body(sub { print $_[1] }); $client−>start($tx); # Custom socket my $tx = $client−>build_tx(GET => 'http://mojolicious.org'); $tx−>connection($socket); $client−>start($tx);
46.
Big Body
Just Works (temp storage on filesystem)
47.
$res->json Automatic JSON deserialization
48.
o(fun) Every file in
the distro has a Simpsons or Futurama quote.
49.
Now also handles
disconnected keep-alive gracefully. (this was not the case when we started using it).
50.
Test Driven Development
51.
You provide failing test.
kraih provides fix.
52.
Learn More Mojo
mojolicious.org github.com/kraih/mojo #mojo on irc.perl.org groups.google.com/group/mojolicious
Notas do Editor
Much of this development was driven by Gisle Aas++ (Oslonett)
Hard to update, because so much depend on the current broken behavior
at Twitter
Maypole was originally developed by Simon Cozens, but he fucked off to become a missionary in Japan.
Catalyst had gathered steam. Core team of developers
Runs in 30 seconds (time to download, run test suite and install files).
All
Tell about nginx and status phrases.
Baixar agora