Fixing flickr parsing
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 29 Jul 2013 11:09:02 +0000 (13:09 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 29 Jul 2013 11:09:02 +0000 (13:09 +0200)
For some images/authors 'photo-name-line-2' is empty.

apps/cover/forms.py

index e373a6c..0173134 100755 (executable)
@@ -63,7 +63,7 @@ class FlickrForm(forms.Form):
         except AssertionError:
             raise forms.ValidationError('Error reading license name.')
 
-        m = re.search(r'<span class="photo-name-line-2">([^<]*)</span>', html)
+        m = re.search(r'"ownername":"([^"]*)', html)
         if m:
             self.cleaned_data['author'] = "%s@Flickr" % m.group(1)
         else: