Show recent Commons uploads obtained via Flickr mail
Display recent Wikimedia Commons uploads on the home page, filtered to only show images that were obtained by contacting creators via Flickr mail. Each upload shows: - Thumbnail linking to Commons - Creator name linking to their Flickr profile - Link to the illustrated Wikipedia article (or Wikidata item) Features: - Parse sent mail messages to extract Flickr and Wikipedia URLs - Match Commons uploads with sent mail by normalized Flickr URL - Cache Commons API thumbnail responses and sent mail index - Handle Wikidata item URLs (Q-numbers) with correct links - Add update_flickr_uploads.py script to find uploads from UploadWizard contributions by checking Commons API metadata Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
0062de8ede
commit
a2d29d7937
6 changed files with 562 additions and 3 deletions
|
|
@ -15,6 +15,47 @@
|
|||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
|
||||
{% if recent_uploads is defined and recent_uploads and not name %}
|
||||
<div class="mt-4">
|
||||
<h5>Recent uploads to Wikimedia Commons</h5>
|
||||
<p class="text-muted small">Photos obtained via Flickr mail requests</p>
|
||||
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 g-3">
|
||||
{% for upload in recent_uploads %}
|
||||
<div class="col">
|
||||
<div class="card h-100">
|
||||
<div class="row g-0">
|
||||
<div class="col-4">
|
||||
<a href="{{ upload.commons_url }}">
|
||||
<img src="{{ upload.thumb_url }}" alt="{{ upload.title }}" class="img-fluid rounded-start" style="aspect-ratio: 1; object-fit: cover; width: 100%;">
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<div class="card-body p-2">
|
||||
<p class="card-text small mb-1 text-truncate" title="{{ upload.title }}">
|
||||
<a href="{{ upload.commons_url }}" class="text-decoration-none">{{ upload.title }}</a>
|
||||
</p>
|
||||
<p class="card-text small mb-1">
|
||||
{% if upload.creator_profile_url %}
|
||||
<a href="{{ upload.creator_profile_url }}" class="text-muted text-decoration-none">{{ upload.creator }}</a>
|
||||
{% else %}
|
||||
<span class="text-muted">{{ upload.creator }}</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if upload.wikipedia_url %}
|
||||
<p class="card-text small mb-0">
|
||||
<a href="{{ upload.wiki_link_url }}" class="text-decoration-none"><small>{{ upload.wiki_link_label }}</small></a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if name and search_result is defined and search_result.photos %}
|
||||
|
||||
<p>Wikipedia article: {{ name }}</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue