vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r20851: LJSUP-10880: LJ::HTML::Metadata should b...

Committer: vsukhanov
LJSUP-10880: LJ::HTML::Metadata should be able to extract content of "og:url" tag
U   trunk/cgi-bin/LJ/HTML/Metadata.pm
Modified: trunk/cgi-bin/LJ/HTML/Metadata.pm
===================================================================
--- trunk/cgi-bin/LJ/HTML/Metadata.pm	2011-12-23 09:15:08 UTC (rev 20850)
+++ trunk/cgi-bin/LJ/HTML/Metadata.pm	2011-12-23 11:08:52 UTC (rev 20851)
@@ -18,7 +18,7 @@
 my ( @metadata_fields, %metadata_fields );
 
 BEGIN {
-    @metadata_fields = qw( title description image );
+    @metadata_fields = qw( title description image og_url );
     @metadata_fields{@metadata_fields} = ();
     @FIELDS = ( qw( url html ua ), @metadata_fields );
 }
@@ -65,6 +65,11 @@
             'extract_attr' => 'content',
             'fill'         => 'og_image'
         },
+        {
+            'require_attr' => { 'property' => 'og:url' },
+            'extract_attr' => 'content',
+            'fill'         => 'og_url'
+        },
     ],
 );
 
@@ -250,6 +255,8 @@
     $self->image( $extracted_data{'og_image'}
           || $extracted_data{'link_image'}
           || $extracted_data{'html_image'} );
+    
+    $self->og_url($extracted_data{'og_url'});
 
     $self->{'_html_parsed'} = 1;
 

Tags: livejournal, pm, vadvs, vsukhanov
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments