mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2011-12-29 09:25 pm

[dw-free] The bio contains the title/subtitle, import those if we can

[commit: http://hg.dwscoalition.org/dw-free/rev/11a1f280a6bf]

The bio contains the title/subtitle, import those if we can

Patch by [staff profile] mark.

Files modified:
  • cgi-bin/DW/Worker/ContentImporter/LiveJournal.pm
  • cgi-bin/DW/Worker/ContentImporter/Local/Bio.pm
--------------------------------------------------------------------------------
diff -r 684ceb031470 -r 11a1f280a6bf cgi-bin/DW/Worker/ContentImporter/LiveJournal.pm
--- a/cgi-bin/DW/Worker/ContentImporter/LiveJournal.pm	Thu Dec 29 19:47:25 2011 +0000
+++ b/cgi-bin/DW/Worker/ContentImporter/LiveJournal.pm	Thu Dec 29 21:29:28 2011 +0000
@@ -8,7 +8,7 @@
 #      Andrea Nall <anall@andreanall.com>
 #      Mark Smith <mark@dreamwidth.org>
 #
-# Copyright (c) 2009 by Dreamwidth Studios, LLC.
+# Copyright (c) 2009-2011 by Dreamwidth Studios, LLC.
 #
 # This program is free software; you may redistribute it and/or modify it under
 # the same terms as Perl itself.  For a copy of the license, please reference
@@ -484,6 +484,8 @@
         'foaf:msnChatID' => 'msn',
         'foaf:yahooChatID' => 'yahoo',
         'ya:bio' => 'bio',
+        'lj:journaltitle' => 'journaltitle',
+        'lj:journalsubtitle' => 'journalsubtitle',
     );
     my %wanted_attrib_items = (
         'foaf:homepage' => { _tag => 'homepage', 'rdf:resource' => 'url', 'dc:title' => 'title'  },
@@ -568,7 +570,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (c) 2009 by Dreamwidth Studios, LLC.
+Copyright (c) 2009-2011 by Dreamwidth Studios, LLC.
 
 This program is free software; you may redistribute it and/or modify it under
 the same terms as Perl itself. For a copy of the license, please reference
diff -r 684ceb031470 -r 11a1f280a6bf cgi-bin/DW/Worker/ContentImporter/Local/Bio.pm
--- a/cgi-bin/DW/Worker/ContentImporter/Local/Bio.pm	Thu Dec 29 19:47:25 2011 +0000
+++ b/cgi-bin/DW/Worker/ContentImporter/Local/Bio.pm	Thu Dec 29 21:29:28 2011 +0000
@@ -59,20 +59,14 @@
 
     $u->set_bio( $items->{'bio'} ) if defined( $items->{'bio'} );
 
-    my %propMap = (
-        'icq' => 'icq',
-        'aolim' => 'aolim',
-        'jabber' => 'jabber',
-        'msn' => 'msn',
-        'yahoo' => 'yahoo',
-    );
-    foreach my $key ( keys %propMap ) {
-        $u->set_prop( $propMap{$key}, $items->{$key} ) if defined($items->{$key});
+    foreach my $prop ( qw/ icq aolim jabber msn yahoo journaltitle journalsubtitle / ) {
+        $u->set_prop( $prop => $items->{$prop} )
+            if defined $items->{$prop};
     }
 
-    if ( defined( $items->{'foaf:homepage'} ) ) {
-        $u->set_prop( 'url', $items->{'homepage'}->{'url'} );
-        $u->set_prop( 'urlname', $items->{'homepage'}->{'title'} );
+    if ( defined $items->{homepage} ) {
+        $u->set_prop( url => $items->{'homepage'}->{'url'} );
+        $u->set_prop( urlname => $items->{'homepage'}->{'title'} );
     }
 }
 
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org