Add WIP script for getting CVE numbers for Solus Thunderbird changelogs

This commit is contained in:
Tracey Clark 2024-02-21 18:48:33 -06:00
commit 005a042263

View file

@ -0,0 +1,41 @@
#!/usr/bin/env perl
use Modern::Perl;
use FindBin;
use lib "$FindBin::RealBin/lib";
use Getopt::Long;
use Pod::Usage;
use WWW::Mechanize;
use Data::Dumper;
my $successful_parse = GetOptions(
'help|?' => \ my $help,
man => \ my $man,
'url=s' => \ my $url
)
or pod2usage(2);
if ( !$successful_parse || ( @ARGV > 1 ) ) {
die qq{Usage: $0 [ --url]\n};
}
if ( !defined $url ) {
die qq{Usage: $0 [ --url]\n};
}
# Get url from input param
# https://www.mozilla.org/en-US/security/advisories/mfsa2024-07/
my $mechanize = WWW::Mechanize->new(autocheck => 1);
$mechanize->get($url);
my $page = $mechanize->content;
# Get text from each level-heading class
# ex
# <h4 id="CVE-2024-1546" class="level-heading">
# And then Metacpan had a 502 so I couldn't find docs on how to get this X|
# Get CVEs in form of CVE-2024-1546