ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/selection-pastebin
(Generate patch)

Comparing rxvt-unicode/src/perl/selection-pastebin (file contents):
Revision 1.1 by elmex, Tue Jan 17 16:53:47 2006 UTC vs.
Revision 1.2 by root, Tue Jan 17 16:57:07 2006 UTC

1#! perl 1#! perl
2use Digest::MD5 qw/md5_hex/;
3 2
4my $timers = {}; 3my $timers = {};
5my $pastebin_cmd; 4my $pastebin_cmd;
6my $pastebin_url; 5my $pastebin_url;
7 6
12 or "scp -p % ruth:/var/www/www.ta-sa.org/files/txt/"; 11 or "scp -p % ruth:/var/www/www.ta-sa.org/files/txt/";
13 12
14 $pastebin_url = 13 $pastebin_url =
15 $self->x_resource ("selection-pastebin-url") 14 $self->x_resource ("selection-pastebin-url")
16 or "http://www.ta-sa.org/files/txt/"; 15 or "http://www.ta-sa.org/files/txt/";
16
17 (); 17 ()
18} 18}
19 19
20sub upload_paste { 20sub upload_paste {
21 my ($self) = @_; 21 my ($self) = @_;
22 22
23 require Digest::MD5;
23 24
24 my $txt = $self->selection; 25 my $txt = $self->selection;
25 my $filename = md5_hex ($txt) . ".txt"; 26 my $filename = Digest::MD5::md5_hex ($txt) . ".txt";
26 27
27 my $tmpfile = "/tmp/$filename"; 28 my $tmpfile = "/tmp/$filename";
28 29
29 my $msg = "uploaded $filename"; 30 my $msg = "uploaded $filename";
30 31

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines