def clean_source_url(self):
url = self.cleaned_data['source_url']
- m = re.match(r'(https?://)?(www.)?flickr.com/photos/(?P<author>[^/]+)/(?P<img>\d+)', url)
+ m = re.match(r'(https?://)?(www\.|secure\.)?flickr\.com/photos/(?P<author>[^/]+)/(?P<img>\d+)', url)
if not m:
raise forms.ValidationError("It doesn't look like Flickr URL.")
author_slug, img_id = m.group('author'), m.group('img')
+++ /dev/null
-{% extends "catalogue/base.html" %}
-
-
-{% block content %}
-<h1>Flickr</h1>
-
-<form method="post">
-{% csrf_token %}
-URL: <input size="50" placeholder="np. http://www.flickr.com/photos/abcdef/1234567890" name="flickr_url" value="{{ url }}"/>
-<input type="submit" value="Generuj metadane" />
-</form>
-
-<textarea style="width:100%" rows="5">
-<dc:relation.coverImage.url xmlns:dc="http://purl.org/dc/elements/1.1/">{{ image_url }}</dc:relation.coverImage.url>
-<dc:relation.coverImage.attribution xmlns:dc="http://purl.org/dc/elements/1.1/">{{ author }}@Flickr, {{ license_name }}</dc:relation.coverImage.attribution>
-<dc:relation.coverImage.source xmlns:dc="http://purl.org/dc/elements/1.1/">{{ url }}</dc:relation.coverImage.source>
-</textarea>
-{% endblock %}