Latest and greatest guestbook script

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

View File

@ -28,18 +28,13 @@ my $dotfile = ".mmCreds.xml";
# Create XML::LibXML object # 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 # Grab the values from creds file
my $user = $dom->findvalue('/credentials/username'); my %conf;
my $pass = $dom->findvalue('/credentials/password'); $conf{'authenticate'} = 1;
my $url = $dom->findvalue('/credentials/base_url'); $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 $chan = $dom->findvalue('/credentials/channel_id');
my $spam = $dom->findvalue('/credentials/spam_chan_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"
);
# Create new WebService::Mattermost objects (mm && resource) # Create new WebService::Mattermost objects (mm && resource)
my $mm = WebService::Mattermost->new(%conf); my $mm = WebService::Mattermost->new(%conf);
my $resource = $mm->api->posts; my $resource = $mm->api->posts;
@ -195,7 +190,6 @@ print $q->header(-charset => 'UTF-8');
# Print the head & title, begin the body # Print the head & title, begin the body
print $q->start_html( print $q->start_html(
#-dtd => 'html',
-title => 'SwaggNet Guestbook', -title => 'SwaggNet Guestbook',
-style => '/css/swagg.css' -style => '/css/swagg.css'
); );