1
0
Fork 0
csbot2/src/modules/pdffer.pm

26 lines
631 B
Perl
Raw Normal View History

2024-02-08 09:10:16 +01:00
package csbot2::pdffer;
use strict;
use warnings;
use LWP::Simple;
use DateTime;
use feature "say";
sub init
{
say "[~] pdffer module init";
}
sub parse
{
my ($self, $line, $irc, $config, $channel, $nick) = @_;
if (/^:(.+?)!.+?@.+? PRIVMSG ${channel} :url2pdf (.+?)$/i)
{
my $api = "http://do.convertapi.com/Web2Pdf?Plugins=true&Timeout=60&ConversionDelay=5&CUrl=" . $2;
my $filename = DateTime -> now . ".pdf";
getstore($api, "../public_html/url2pdf/" . $filename);
say $irc "PRIVMSG $channel :Converted! Download at https://www.niggazwithattitu.de/u/wasp/url2pdf/$filename";
}
return 0;
}
1;