Latest and greatest guestbook script

This commit is contained in:
swagg boi 2021-06-10 21:05:30 -04:00
parent e46e0b78c4
commit 202094b660

View file

@ -24,25 +24,20 @@ open(my $thoughtCrimes, '.msg.bans') or die "$@";
open(my $nameBans, '.name.bans') or die "$@";
# Get creds file
my $dotfile = ".mmCreds.xml";
my $dotfile = ".mmCreds.xml";
# Create XML::LibXML object
my $dom = XML::LibXML->load_xml(location => $dotfile);
my $dom = XML::LibXML->load_xml(location => $dotfile);
# Grab the values from creds file
my $user = $dom->findvalue('/credentials/username');
my $pass = $dom->findvalue('/credentials/password');
my $url = $dom->findvalue('/credentials/base_url');
my $chan = $dom->findvalue('/credentials/channel_id');
my $spam = $dom->findvalue('/credentials/spam_chan_id');
# Put the values into place
my %conf = (
authenticate => 1,
username => "$user",
password => "$pass",
base_url => "$url"
);
my %conf;
$conf{'authenticate'} = 1;
$conf{'username'} = $dom->findvalue('/credentials/username');
$conf{'password'} = $dom->findvalue('/credentials/password');
$conf{'base_url'} = $dom->findvalue('/credentials/base_url');
my $chan = $dom->findvalue('/credentials/channel_id');
my $spam = $dom->findvalue('/credentials/spam_chan_id');
# Create new WebService::Mattermost objects (mm && resource)
my $mm = WebService::Mattermost->new(%conf);
my $resource = $mm->api->posts;
my $mm = WebService::Mattermost->new(%conf);
my $resource = $mm->api->posts;
## Functions ##
@ -195,7 +190,6 @@ print $q->header(-charset => 'UTF-8');
# Print the head & title, begin the body
print $q->start_html(
#-dtd => 'html',
-title => 'SwaggNet Guestbook',
-style => '/css/swagg.css'
);