From: Petter Reinholdtsen Date: Sat, 28 Feb 2009 22:54:20 +0000 (+0000) Subject: Correct HTML. Regenerate. X-Git-Url: https://pere.pagekite.me/gitweb/homepage.git/commitdiff_plain/40efbaabb1cb45747ac173391a8d97ccd8d558d5?ds=sidebyside;hp=e8235ae50c510203c61fa611a2f767130d52884b Correct HTML. Regenerate. --- diff --git a/blog/Checking_server_hardware_support_status_for_Dell__HP_and_IBM_servers.html b/blog/Checking_server_hardware_support_status_for_Dell__HP_and_IBM_servers.html index 530b7e7315..547c73c3f7 100644 --- a/blog/Checking_server_hardware_support_status_for_Dell__HP_and_IBM_servers.html +++ b/blog/Checking_server_hardware_support_status_for_Dell__HP_and_IBM_servers.html @@ -55,7 +55,7 @@ scraping was written by me based on the Dell code. I know the HTML parsing could be done using nice libraries, but did not want to introduce more dependencies. This is the current incarnation:

-

+
 use LWP::Simple;
 use POSIX;
 use WWW::Mechanize;
@@ -67,7 +67,7 @@ sub get_support_info {
 
     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);
 
@@ -75,7 +75,7 @@ sub get_support_info {
         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";
@@ -101,7 +101,7 @@ sub get_support_info {
         # 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;
@@ -124,11 +124,11 @@ sub get_support_info {
         }
     } 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;
@@ -146,19 +146,19 @@ sub get_support_info {
     }
     return $str;
 }
-

+

Here are some examples on how to use the function, using fake serial numbers. The information passed in as arguments are fetched from dmidecode.

-

+
 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");
-

+

I would recommend this approach for tracking support contracts for everyone with more than a new computers to administer. :)

diff --git a/blog/archive/2009/02/02.rss b/blog/archive/2009/02/02.rss index b6364f1a32..af03604c65 100644 --- a/blog/archive/2009/02/02.rss +++ b/blog/archive/2009/02/02.rss @@ -255,7 +255,7 @@ scraping was written by me based on the Dell code. I know the HTML 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; @@ -267,7 +267,7 @@ sub get_support_info { 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); @@ -275,7 +275,7 @@ sub get_support_info { 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"; @@ -301,7 +301,7 @@ sub get_support_info { # 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; @@ -324,11 +324,11 @@ sub get_support_info { } } 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; @@ -346,19 +346,19 @@ sub get_support_info { } 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> diff --git a/blog/archive/2009/02/index.html b/blog/archive/2009/02/index.html index 1175b02540..98e805dfd7 100644 --- a/blog/archive/2009/02/index.html +++ b/blog/archive/2009/02/index.html @@ -364,7 +364,7 @@ scraping was written by me based on the Dell code. I know the HTML parsing could be done using nice libraries, but did not want to introduce more dependencies. This is the current incarnation:

-

+
 use LWP::Simple;
 use POSIX;
 use WWW::Mechanize;
@@ -376,7 +376,7 @@ sub get_support_info {
 
     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);
 
@@ -384,7 +384,7 @@ sub get_support_info {
         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";
@@ -410,7 +410,7 @@ sub get_support_info {
         # 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;
@@ -433,11 +433,11 @@ sub get_support_info {
         }
     } 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;
@@ -455,19 +455,19 @@ sub get_support_info {
     }
     return $str;
 }
-

+

Here are some examples on how to use the function, using fake serial numbers. The information passed in as arguments are fetched from dmidecode.

-

+
 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");
-

+

I would recommend this approach for tracking support contracts for everyone with more than a new computers to administer. :)

diff --git a/blog/index.html b/blog/index.html index 09f494e8af..7261aeee6b 100644 --- a/blog/index.html +++ b/blog/index.html @@ -58,7 +58,7 @@ scraping was written by me based on the Dell code. I know the HTML parsing could be done using nice libraries, but did not want to introduce more dependencies. This is the current incarnation:

-

+
 use LWP::Simple;
 use POSIX;
 use WWW::Mechanize;
@@ -70,7 +70,7 @@ sub get_support_info {
 
     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);
 
@@ -78,7 +78,7 @@ sub get_support_info {
         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";
@@ -104,7 +104,7 @@ sub get_support_info {
         # 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;
@@ -127,11 +127,11 @@ sub get_support_info {
         }
     } 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;
@@ -149,19 +149,19 @@ sub get_support_info {
     }
     return $str;
 }
-

+

Here are some examples on how to use the function, using fake serial numbers. The information passed in as arguments are fetched from dmidecode.

-

+
 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");
-

+

I would recommend this approach for tracking support contracts for everyone with more than a new computers to administer. :)

diff --git a/blog/index.rss b/blog/index.rss index c593ae74df..4dc5fbc390 100644 --- a/blog/index.rss +++ b/blog/index.rss @@ -47,7 +47,7 @@ scraping was written by me based on the Dell code. I know the HTML 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; @@ -59,7 +59,7 @@ sub get_support_info { 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); @@ -67,7 +67,7 @@ sub get_support_info { 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"; @@ -93,7 +93,7 @@ sub get_support_info { # 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; @@ -116,11 +116,11 @@ sub get_support_info { } } 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; @@ -138,19 +138,19 @@ sub get_support_info { } 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> diff --git a/blog/tags/english/english.rss b/blog/tags/english/english.rss index f329c7b6b6..0d39669db5 100644 --- a/blog/tags/english/english.rss +++ b/blog/tags/english/english.rss @@ -231,7 +231,7 @@ scraping was written by me based on the Dell code. I know the HTML 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; @@ -243,7 +243,7 @@ sub get_support_info { 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); @@ -251,7 +251,7 @@ sub get_support_info { 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"; @@ -277,7 +277,7 @@ sub get_support_info { # 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; @@ -300,11 +300,11 @@ sub get_support_info { } } 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; @@ -322,19 +322,19 @@ sub get_support_info { } 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> diff --git a/blog/tags/english/index.html b/blog/tags/english/index.html index 039f4510cb..cbac49c301 100644 --- a/blog/tags/english/index.html +++ b/blog/tags/english/index.html @@ -315,7 +315,7 @@ scraping was written by me based on the Dell code. I know the HTML parsing could be done using nice libraries, but did not want to introduce more dependencies. This is the current incarnation:

-

+
 use LWP::Simple;
 use POSIX;
 use WWW::Mechanize;
@@ -327,7 +327,7 @@ sub get_support_info {
 
     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);
 
@@ -335,7 +335,7 @@ sub get_support_info {
         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";
@@ -361,7 +361,7 @@ sub get_support_info {
         # 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;
@@ -384,11 +384,11 @@ sub get_support_info {
         }
     } 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;
@@ -406,19 +406,19 @@ sub get_support_info {
     }
     return $str;
 }
-

+

Here are some examples on how to use the function, using fake serial numbers. The information passed in as arguments are fetched from dmidecode.

-

+
 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");
-

+

I would recommend this approach for tracking support contracts for everyone with more than a new computers to administer. :)

diff --git a/blog/tags/nuug/index.html b/blog/tags/nuug/index.html index 4ae881dc31..c6ffabdad2 100644 --- a/blog/tags/nuug/index.html +++ b/blog/tags/nuug/index.html @@ -1046,7 +1046,7 @@ scraping was written by me based on the Dell code. I know the HTML parsing could be done using nice libraries, but did not want to introduce more dependencies. This is the current incarnation:

-

+
 use LWP::Simple;
 use POSIX;
 use WWW::Mechanize;
@@ -1058,7 +1058,7 @@ sub get_support_info {
 
     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);
 
@@ -1066,7 +1066,7 @@ sub get_support_info {
         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";
@@ -1092,7 +1092,7 @@ sub get_support_info {
         # 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;
@@ -1115,11 +1115,11 @@ sub get_support_info {
         }
     } 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;
@@ -1137,19 +1137,19 @@ sub get_support_info {
     }
     return $str;
 }
-

+

Here are some examples on how to use the function, using fake serial numbers. The information passed in as arguments are fetched from dmidecode.

-

+
 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");
-

+

I would recommend this approach for tracking support contracts for everyone with more than a new computers to administer. :)

diff --git a/blog/tags/nuug/nuug.rss b/blog/tags/nuug/nuug.rss index e49d9f436f..281e3f44ba 100644 --- a/blog/tags/nuug/nuug.rss +++ b/blog/tags/nuug/nuug.rss @@ -780,7 +780,7 @@ scraping was written by me based on the Dell code. I know the HTML 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; @@ -792,7 +792,7 @@ sub get_support_info { 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); @@ -800,7 +800,7 @@ sub get_support_info { 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"; @@ -826,7 +826,7 @@ sub get_support_info { # 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; @@ -849,11 +849,11 @@ sub get_support_info { } } 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; @@ -871,19 +871,19 @@ sub get_support_info { } 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>