Skip to content

Commit

Permalink
use consistent terminology
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 19, 2014
1 parent bd13f81 commit 3b04921
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -75,8 +75,8 @@ get '/' => {template => 'index'};
websocket '/title' => sub {
my $c = shift;
$c->on(message => sub {
my ($c, $url) = @_;
my $title = $c->ua->get($url)->res->dom->at('title')->text;
my ($c, $msg) = @_;
my $title = $c->ua->get($msg)->res->dom->at('title')->text;
$c->send($title);
});
};
Expand All @@ -85,9 +85,9 @@ app->start;
__DATA__
@@ index.html.ep
% my $websocket = url_for 'title';
% my $url = url_for 'title';
<script>
var ws = new WebSocket('<%= $websocket->to_abs %>');
var ws = new WebSocket('<%= $url->to_abs %>');
ws.onmessage = function (event) { document.body.innerHTML += event.data };
ws.onopen = function (event) { ws.send('http://mojolicio.us') };
</script>
Expand Down

0 comments on commit 3b04921

Please sign in to comment.