parsing could be done using nice libraries, but did not want to
introduce more dependencies. This is the current incarnation:</p>
-<p><pre>
+<pre>
use LWP::Simple;
use POSIX;
use WWW::Mechanize;
if ( $model =~ m/^Dell / ) {
# fetch website from Dell support
- my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
+ my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
my $webpage = get($url);
return undef unless ($webpage);
my @lines = split(/\n/, $webpage);
foreach my $line (@lines) {
next unless ($line =~ m/Beskrivelse/);
- $line =~ s/<[^>]+?>/;/gm;
+ $line =~ s/<[^>]+?>/;/gm;
$line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
my $start = "$3-$1-$2";
my $end = "$6-$4-$5";
# Next step is screen scraping
my $content = $mech->content();
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/<[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
} elsif ( $model =~ m/^IBM / ) {
my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
- if ($producttype && $serial) {
+ if ($producttype && $serial) {
my $content =
- get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
+ get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
if ($content) {
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/<[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
return $str;
}
-</pre></p>
+</pre>
<p>Here are some examples on how to use the function, using fake
serial numbers. The information passed in as arguments are fetched
from dmidecode.</p>
-<p><pre>
+<pre>
print get_support_info("hp.host", "HP ProLiant BL460c G1", "1234567890"
"447707-B21");
print get_support_info("dell.host", "Dell Inc. PowerEdge 2950", "1234567");
print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
"1234567");
-</pre></p>
+</pre>
<p>I would recommend this approach for tracking support contracts for
everyone with more than a new computers to administer. :)</p>
parsing could be done using nice libraries, but did not want to
introduce more dependencies. This is the current incarnation:</p>
-<p><pre>
+<pre>
use LWP::Simple;
use POSIX;
use WWW::Mechanize;
if ( $model =~ m/^Dell / ) {
# fetch website from Dell support
- my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
+ my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&amp;cs=nodhs1&amp;l=no&amp;s=dhs&amp;ServiceTag=$serial";
my $webpage = get($url);
return undef unless ($webpage);
my @lines = split(/\n/, $webpage);
foreach my $line (@lines) {
next unless ($line =~ m/Beskrivelse/);
- $line =~ s/<[^>]+?>/;/gm;
+ $line =~ s/&lt;[^>]+?>/;/gm;
$line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
my $start = "$3-$1-$2";
my $end = "$6-$4-$5";
# Next step is screen scraping
my $content = $mech->content();
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/&lt;[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
} elsif ( $model =~ m/^IBM / ) {
my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
- if ($producttype && $serial) {
+ if ($producttype &amp;&amp; $serial) {
my $content =
- get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
+ get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&amp;brandind=5000008&amp;Submit=Submit&amp;type=$producttype&amp;serial=$serial");
if ($content) {
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/&lt;[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
return $str;
}
-</pre></p>
+</pre>
<p>Here are some examples on how to use the function, using fake
serial numbers. The information passed in as arguments are fetched
from dmidecode.</p>
-<p><pre>
+<pre>
print get_support_info("hp.host", "HP ProLiant BL460c G1", "1234567890"
"447707-B21");
print get_support_info("dell.host", "Dell Inc. PowerEdge 2950", "1234567");
print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
"1234567");
-</pre></p>
+</pre>
<p>I would recommend this approach for tracking support contracts for
everyone with more than a new computers to administer. :)</p>
parsing could be done using nice libraries, but did not want to
introduce more dependencies. This is the current incarnation:</p>
-<p><pre>
+<pre>
use LWP::Simple;
use POSIX;
use WWW::Mechanize;
if ( $model =~ m/^Dell / ) {
# fetch website from Dell support
- my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
+ my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
my $webpage = get($url);
return undef unless ($webpage);
my @lines = split(/\n/, $webpage);
foreach my $line (@lines) {
next unless ($line =~ m/Beskrivelse/);
- $line =~ s/<[^>]+?>/;/gm;
+ $line =~ s/<[^>]+?>/;/gm;
$line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
my $start = "$3-$1-$2";
my $end = "$6-$4-$5";
# Next step is screen scraping
my $content = $mech->content();
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/<[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
} elsif ( $model =~ m/^IBM / ) {
my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
- if ($producttype && $serial) {
+ if ($producttype && $serial) {
my $content =
- get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
+ get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
if ($content) {
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/<[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
return $str;
}
-</pre></p>
+</pre>
<p>Here are some examples on how to use the function, using fake
serial numbers. The information passed in as arguments are fetched
from dmidecode.</p>
-<p><pre>
+<pre>
print get_support_info("hp.host", "HP ProLiant BL460c G1", "1234567890"
"447707-B21");
print get_support_info("dell.host", "Dell Inc. PowerEdge 2950", "1234567");
print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
"1234567");
-</pre></p>
+</pre>
<p>I would recommend this approach for tracking support contracts for
everyone with more than a new computers to administer. :)</p>
parsing could be done using nice libraries, but did not want to
introduce more dependencies. This is the current incarnation:</p>
-<p><pre>
+<pre>
use LWP::Simple;
use POSIX;
use WWW::Mechanize;
if ( $model =~ m/^Dell / ) {
# fetch website from Dell support
- my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
+ my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
my $webpage = get($url);
return undef unless ($webpage);
my @lines = split(/\n/, $webpage);
foreach my $line (@lines) {
next unless ($line =~ m/Beskrivelse/);
- $line =~ s/<[^>]+?>/;/gm;
+ $line =~ s/<[^>]+?>/;/gm;
$line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
my $start = "$3-$1-$2";
my $end = "$6-$4-$5";
# Next step is screen scraping
my $content = $mech->content();
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/<[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
} elsif ( $model =~ m/^IBM / ) {
my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
- if ($producttype && $serial) {
+ if ($producttype && $serial) {
my $content =
- get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
+ get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
if ($content) {
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/<[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
return $str;
}
-</pre></p>
+</pre>
<p>Here are some examples on how to use the function, using fake
serial numbers. The information passed in as arguments are fetched
from dmidecode.</p>
-<p><pre>
+<pre>
print get_support_info("hp.host", "HP ProLiant BL460c G1", "1234567890"
"447707-B21");
print get_support_info("dell.host", "Dell Inc. PowerEdge 2950", "1234567");
print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
"1234567");
-</pre></p>
+</pre>
<p>I would recommend this approach for tracking support contracts for
everyone with more than a new computers to administer. :)</p>
parsing could be done using nice libraries, but did not want to
introduce more dependencies. This is the current incarnation:</p>
-<p><pre>
+<pre>
use LWP::Simple;
use POSIX;
use WWW::Mechanize;
if ( $model =~ m/^Dell / ) {
# fetch website from Dell support
- my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
+ my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&amp;cs=nodhs1&amp;l=no&amp;s=dhs&amp;ServiceTag=$serial";
my $webpage = get($url);
return undef unless ($webpage);
my @lines = split(/\n/, $webpage);
foreach my $line (@lines) {
next unless ($line =~ m/Beskrivelse/);
- $line =~ s/<[^>]+?>/;/gm;
+ $line =~ s/&lt;[^>]+?>/;/gm;
$line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
my $start = "$3-$1-$2";
my $end = "$6-$4-$5";
# Next step is screen scraping
my $content = $mech->content();
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/&lt;[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
} elsif ( $model =~ m/^IBM / ) {
my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
- if ($producttype && $serial) {
+ if ($producttype &amp;&amp; $serial) {
my $content =
- get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
+ get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&amp;brandind=5000008&amp;Submit=Submit&amp;type=$producttype&amp;serial=$serial");
if ($content) {
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/&lt;[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
return $str;
}
-</pre></p>
+</pre>
<p>Here are some examples on how to use the function, using fake
serial numbers. The information passed in as arguments are fetched
from dmidecode.</p>
-<p><pre>
+<pre>
print get_support_info("hp.host", "HP ProLiant BL460c G1", "1234567890"
"447707-B21");
print get_support_info("dell.host", "Dell Inc. PowerEdge 2950", "1234567");
print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
"1234567");
-</pre></p>
+</pre>
<p>I would recommend this approach for tracking support contracts for
everyone with more than a new computers to administer. :)</p>
parsing could be done using nice libraries, but did not want to
introduce more dependencies. This is the current incarnation:</p>
-<p><pre>
+<pre>
use LWP::Simple;
use POSIX;
use WWW::Mechanize;
if ( $model =~ m/^Dell / ) {
# fetch website from Dell support
- my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
+ my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&amp;cs=nodhs1&amp;l=no&amp;s=dhs&amp;ServiceTag=$serial";
my $webpage = get($url);
return undef unless ($webpage);
my @lines = split(/\n/, $webpage);
foreach my $line (@lines) {
next unless ($line =~ m/Beskrivelse/);
- $line =~ s/<[^>]+?>/;/gm;
+ $line =~ s/&lt;[^>]+?>/;/gm;
$line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
my $start = "$3-$1-$2";
my $end = "$6-$4-$5";
# Next step is screen scraping
my $content = $mech->content();
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/&lt;[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
} elsif ( $model =~ m/^IBM / ) {
my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
- if ($producttype && $serial) {
+ if ($producttype &amp;&amp; $serial) {
my $content =
- get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
+ get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&amp;brandind=5000008&amp;Submit=Submit&amp;type=$producttype&amp;serial=$serial");
if ($content) {
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/&lt;[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
return $str;
}
-</pre></p>
+</pre>
<p>Here are some examples on how to use the function, using fake
serial numbers. The information passed in as arguments are fetched
from dmidecode.</p>
-<p><pre>
+<pre>
print get_support_info("hp.host", "HP ProLiant BL460c G1", "1234567890"
"447707-B21");
print get_support_info("dell.host", "Dell Inc. PowerEdge 2950", "1234567");
print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
"1234567");
-</pre></p>
+</pre>
<p>I would recommend this approach for tracking support contracts for
everyone with more than a new computers to administer. :)</p>
parsing could be done using nice libraries, but did not want to
introduce more dependencies. This is the current incarnation:</p>
-<p><pre>
+<pre>
use LWP::Simple;
use POSIX;
use WWW::Mechanize;
if ( $model =~ m/^Dell / ) {
# fetch website from Dell support
- my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
+ my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
my $webpage = get($url);
return undef unless ($webpage);
my @lines = split(/\n/, $webpage);
foreach my $line (@lines) {
next unless ($line =~ m/Beskrivelse/);
- $line =~ s/<[^>]+?>/;/gm;
+ $line =~ s/<[^>]+?>/;/gm;
$line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
my $start = "$3-$1-$2";
my $end = "$6-$4-$5";
# Next step is screen scraping
my $content = $mech->content();
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/<[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
} elsif ( $model =~ m/^IBM / ) {
my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
- if ($producttype && $serial) {
+ if ($producttype && $serial) {
my $content =
- get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
+ get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
if ($content) {
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/<[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
return $str;
}
-</pre></p>
+</pre>
<p>Here are some examples on how to use the function, using fake
serial numbers. The information passed in as arguments are fetched
from dmidecode.</p>
-<p><pre>
+<pre>
print get_support_info("hp.host", "HP ProLiant BL460c G1", "1234567890"
"447707-B21");
print get_support_info("dell.host", "Dell Inc. PowerEdge 2950", "1234567");
print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
"1234567");
-</pre></p>
+</pre>
<p>I would recommend this approach for tracking support contracts for
everyone with more than a new computers to administer. :)</p>
parsing could be done using nice libraries, but did not want to
introduce more dependencies. This is the current incarnation:</p>
-<p><pre>
+<pre>
use LWP::Simple;
use POSIX;
use WWW::Mechanize;
if ( $model =~ m/^Dell / ) {
# fetch website from Dell support
- my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
+ my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
my $webpage = get($url);
return undef unless ($webpage);
my @lines = split(/\n/, $webpage);
foreach my $line (@lines) {
next unless ($line =~ m/Beskrivelse/);
- $line =~ s/<[^>]+?>/;/gm;
+ $line =~ s/<[^>]+?>/;/gm;
$line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
my $start = "$3-$1-$2";
my $end = "$6-$4-$5";
# Next step is screen scraping
my $content = $mech->content();
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/<[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
} elsif ( $model =~ m/^IBM / ) {
my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
- if ($producttype && $serial) {
+ if ($producttype && $serial) {
my $content =
- get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
+ get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
if ($content) {
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/<[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
return $str;
}
-</pre></p>
+</pre>
<p>Here are some examples on how to use the function, using fake
serial numbers. The information passed in as arguments are fetched
from dmidecode.</p>
-<p><pre>
+<pre>
print get_support_info("hp.host", "HP ProLiant BL460c G1", "1234567890"
"447707-B21");
print get_support_info("dell.host", "Dell Inc. PowerEdge 2950", "1234567");
print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
"1234567");
-</pre></p>
+</pre>
<p>I would recommend this approach for tracking support contracts for
everyone with more than a new computers to administer. :)</p>
parsing could be done using nice libraries, but did not want to
introduce more dependencies. This is the current incarnation:</p>
-<p><pre>
+<pre>
use LWP::Simple;
use POSIX;
use WWW::Mechanize;
if ( $model =~ m/^Dell / ) {
# fetch website from Dell support
- my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&cs=nodhs1&l=no&s=dhs&ServiceTag=$serial";
+ my $url = "http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&amp;cs=nodhs1&amp;l=no&amp;s=dhs&amp;ServiceTag=$serial";
my $webpage = get($url);
return undef unless ($webpage);
my @lines = split(/\n/, $webpage);
foreach my $line (@lines) {
next unless ($line =~ m/Beskrivelse/);
- $line =~ s/<[^>]+?>/;/gm;
+ $line =~ s/&lt;[^>]+?>/;/gm;
$line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
my $start = "$3-$1-$2";
my $end = "$6-$4-$5";
# Next step is screen scraping
my $content = $mech->content();
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/&lt;[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
} elsif ( $model =~ m/^IBM / ) {
my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
- if ($producttype && $serial) {
+ if ($producttype &amp;&amp; $serial) {
my $content =
- get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&brandind=5000008&Submit=Submit&type=$producttype&serial=$serial");
+ get("http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&amp;brandind=5000008&amp;Submit=Submit&amp;type=$producttype&amp;serial=$serial");
if ($content) {
- $content =~ s/<[^>]+?>/;/gm;
+ $content =~ s/&lt;[^>]+?>/;/gm;
$content =~ s/\s+/ /gm;
$content =~ s/;\s*;/;;/gm;
$content =~ s/;[\s;]+/;/gm;
}
return $str;
}
-</pre></p>
+</pre>
<p>Here are some examples on how to use the function, using fake
serial numbers. The information passed in as arguments are fetched
from dmidecode.</p>
-<p><pre>
+<pre>
print get_support_info("hp.host", "HP ProLiant BL460c G1", "1234567890"
"447707-B21");
print get_support_info("dell.host", "Dell Inc. PowerEdge 2950", "1234567");
print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
"1234567");
-</pre></p>
+</pre>
<p>I would recommend this approach for tracking support contracts for
everyone with more than a new computers to administer. :)</p>