Data::OpenGraph - Parse OpenGraph Contents
use Data::OpenGraph; my $og = Data::OpenGraph->parse_uri( "http://some.content/with/opengraph.html" ); my $ua = LWP::UserAgent->new(); my $res = $ua->get( "http://some.content/with/opengraph.html" ); my $og = Data::OpenGraph->parse_uri( $res->decoded_content ); my $title = $og->property( "title" ); my $type = $og->property( "type" );
WARNINGS: ALPHA CODE! Probably very incomplete. Please send pull-reqs if you would like this module to be better
Data::OpenGraph is a simple Opengraph ( http://ogp.me ) parser. It just parses some HTML looking for meta tags with property attribute that looks like "og:.+".
Currently nested attributes such as "audio:title", "audio:artist" are store verbatim, so you need to access them like:
$og->property( "audio:title" ); $og->property( "audio:artist" );
Creates a new OpenGraph container. You probably won't be using this much.
Creates a new OpenGraph container by parsing $string.
Fetches the uri, then creates a new OpenGraph container by parsing the content. On HTTP errors, this method will croak.
RDF::RDFa::Parser
Daisuke Maki <daisuke@endeworks.jp>
<daisuke@endeworks.jp>
Copyright (C) 2011 by Daisuke Maki
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.
To install Data::OpenGraph, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::OpenGraph
CPAN shell
perl -MCPAN -e shell install Data::OpenGraph
For more information on module installation, please visit the detailed CPAN module installation guide.