-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbeep_mech
More file actions
executable file
·87 lines (52 loc) · 1.59 KB
/
Copy pathbeep_mech
File metadata and controls
executable file
·87 lines (52 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/perl
use strict;
use WWW::Mechanize;
my $m = WWW::Mechanize->new;
$SIG{INT} = sub { print "\e[?25h\n" and exit };
my $url = 'http://cyanode.nadim.cc/';
$m->get($url);
$|++;
printf("\e[?25l");
while(1) {
$m->submit(
button => 'BEEP',
) or do { $m->get($url) and next };
my ($beep) = $m->find_all_submits();
$beep = $beep->{value_name};
my($beeps, $msg) = $beep =~ m{(\d+) (.+)};
printf("\e[31m\e[1m%s\e[m %s\r", $beeps, $msg);
sleep 1;
}
__END__
=pod
=head1 NAME
beep - beep and watch beeps being beeped at Kaepora's server.
=head1 USAGE
beep
=head1 DESCRIPTION
B<beep> will constantly send beeps to the L<cyanode.nadim.cc> server as
described here: L<http://www.reddit.com/r/linux/comments/fmvbb/i_setup_a_server_in_my_bedroom_that_beeps/>
It well also let you see the total number of beeps beeped in realtime!
=head1 REPORTING BUGS
Report bugs and/or feature requests on rt.cpan.org, the repository issue tracker
or directly to L<magnus@trapd00r.se>
=head1 AUTHOR
Magnus Woldrich
CPAN ID: WOLDRICH
magnus@trapd00r.se
http://japh.se
=head1 CONTRIBUTORS
None required yet.
=head1 COPYRIGHT
Copyright 2011 the B<beep> L</AUTHOR> and L</CONTRIBUTORS> as listed
above.
=head1 LICENSE
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 SEE ALSO
L<http://www.reddit.com/r/linux/comments/fmvbb/i_setup_a_server_in_my_bedroom_that_beeps/>
L<http://cyanode.nadim.cc/index.php>
L<http://www.youtube.com/watch?v=doQZYnliquk>
L<http://www.youtube.com/watch?v=z_L4G4Im_MI>
=cut
# vim: set ts=2 et sw=2: