New feature in module HTML::HeadParser

Stefan Berger <[email protected]> Tue, 14 May 2013 09:15:17 +0200
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
--Apple-Mail=_2C5890DE-C984-4600-9496-0CC9D6F745E8
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252

Hi,
it would be nice if the module can parse meta-tags with the attribute =
'property' like:

<meta property=3D"og:type" content=3D"university">

that come from open graph, Facebook in the module HTML::HeadParser
I know this is not standard, but they exist in many html documents=85.


A possible solution could be in 'sub start':

if ($attr->{name}) { $key =3D "X-Meta-\u$attr->{name}"; }
elsif ($attr->{property}) { $key =3D "X-Meta-\u$attr->{property}"; }
elsif ($attr->{charset}) {



Thanks for your work,
kind reagards Stefan

--
------------------------------------------------------------
Stefan Berger + Monica Moran
Wiesenweg 11
4144 Arlesheim
------------------------------------------------------------







--Apple-Mail=_2C5890DE-C984-4600-9496-0CC9D6F745E8
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=windows-1252

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; =
">Hi,<br>it would be nice if the module can parse meta-tags with the =
attribute 'property' =
like:<br><br>&lt;meta&nbsp;<b>property</b>=3D"og:type"&nbsp;content=3D"uni=
versity"&gt;<br><br>that come from open graph, Facebook in the =
module&nbsp;HTML::HeadParser<br>I know this is not standard, but they =
exist in many html documents=85.<br><br><br>A possible solution could be =
in 'sub start':<br><br>if ($attr-&gt;{name}) { $key =3D =
"X-Meta-\u$attr-&gt;{name}"; }<br><b>elsif ($attr-&gt;{property}) { $key =
=3D "X-Meta-\u$attr-&gt;{property}"; }<br></b>elsif =
($attr-&gt;{charset}) {<br><br><br><br>Thanks for your work,<br>kind =
reagards =
Stefan<br><br>--<br>------------------------------------------------------=
------<br>Stefan Berger + Monica Moran<br>Wiesenweg 11<br>4144 =
Arlesheim<br>------------------------------------------------------------<=
br><br><br><br><br><br><br></body></html>=

--Apple-Mail=_2C5890DE-C984-4600-9496-0CC9D6F745E8--