1

WIP Adding paste and image download modules

* Adding link shortener/paste module
* Adding image downloder
* Added TODO/Wish list
* add Exporter to modules
This commit is contained in:
eleksir
2019-09-03 22:43:05 +03:00
parent 5b17cfaa74
commit 183dee668d
8 changed files with 212 additions and 16 deletions

30
lib/paste.pm Normal file
View File

@@ -0,0 +1,30 @@
package paste;
use strict;
use vars qw/$VERSION/;
$VERSION = "1.0";
sub shorten {
if (defined($env{HTTP_LINK}) {
} else {
if (defined($env{'QUERY_STRING'}) && $env{'QUERY_STRING'} < 8) {
unless (open (L, "data/links.txt")) {
return('500', 'text/plain', "Bad permission\n");
}
while (my $str = <L>) {
}
return('302', 'text/plain', "$link\n");
} else {
return ('200', 'text/plain', "What?\n");
}
}
return ('200', 'text/plain', "$msg\n");
}
1;