3 # Copyright (C) 2008, Parrot Foundation.
4 # $Id: nopaste.pl 38612 2009-05-08 18:30:25Z Infinoid $
15 my $server = 'scsys.co.uk';
16 my $url = "http://$server:8001/paste";
18 c => '#sdl', # channel
19 n => getlogin || getpwuid($<) || 'someone', # name
23 getopt( 'c:n:t:', $opt );
26 unless defined $opt->{t};
29 my $text; while(<>) { $text .= $_; }
30 my $mech = WWW::Mechanize->new(
38 form_name => 'pasteForm',
41 (channel => $opt->{c}) :
51 my @link = $mech->links;
52 print "Your paste can be found at ", $link[0]->url, "\n";
57 tools/dev/nopaste.pl - paste the contents of a file via a pastebot server
61 nopaste.pl -t "TITLE" [ -c CHANNEL ] [ -n NAME ] [ FILENAME ]
63 TITLE the title of the paste
64 CHANNEL the irc channel (defaults to #parrot)
65 NAME the username (defaults to username or 'someone')
66 FILENAME the name of the file to paste (defaults to STDIN)
70 This program can be used to paste the contents of a file on a pastebot server
71 -- specifically, B<nopaste.snit.ch> -- for immediate linkage on an IRC channel --
76 Originally written by particle, with subsequent contributions to functionality
77 by LimbicRegion, paultcochrane and cotto.
83 # cperl-indent-level: 4
86 # vim: expandtab shiftwidth=4: