1 | #! perl |
1 | #! perl |
2 | |
2 | |
3 | #:META:X_RESOURCE:%.cmd:string:the command to run create a new pastebin |
3 | #:META:RESOURCE:%.cmd:string:the command to run create a new pastebin |
4 | #:META:X_RESOURCE:%.url:string:the url template for new pastebins |
4 | #:META:RESOURCE:%.url:string:the url template for new pastebins |
5 | |
5 | |
6 | =head1 NAME |
6 | =head1 NAME |
7 | |
7 | |
8 | selection-pastebin - automatic pastebin upload |
8 | selection-pastebin - automatic pastebin upload |
9 | |
9 | |
10 | =head1 DESCRPTION |
10 | =head1 DESCRIPTION |
11 | |
11 | |
12 | This is a little rarely useful extension that uploads the selection as |
12 | This is a little rarely useful extension that uploads the selection as |
13 | textfile to a remote site (or does other things). (The implementation is |
13 | textfile to a remote site (or does other things). (The implementation is |
14 | not currently secure for use in a multiuser environment as it writes to |
14 | not currently secure for use in a multiuser environment as it writes to |
15 | F</tmp> directly.). |
15 | F</tmp> directly.). |
… | |
… | |
113 | }; |
113 | }; |
114 | |
114 | |
115 | () |
115 | () |
116 | } |
116 | } |
117 | |
117 | |
118 | sub on_user_command { |
118 | sub on_action { |
119 | my ($self, $cmd) = @_; |
119 | my ($self, $action) = @_; |
120 | |
120 | |
121 | if ($cmd eq "selection-pastebin:remote-pastebin") { |
121 | $action eq "remote-pastebin" |
122 | $self->upload_paste; |
122 | and $self->upload_paste; |
123 | } |
|
|
124 | |
123 | |
125 | () |
124 | () |
126 | } |
125 | } |
127 | |
126 | |