Extension:FlickrImporter

Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:GPL licensed extensions
MediaWiki extensions manual
FlickrImporter
Release status: betaCategory:Beta status extensions
Implementation Parser function Category:Parser function extensions, Special page Category:Special page extensions
Description Allows for importing photos from Flickr
Author(s) Sam Wilson (samwilsontalk)
Latest version 0.1.0 (2018-05-03)
MediaWiki 1.30+Category:Extensions with manual MediaWiki version
PHP 5.5+
Database changes No
Composer samwilson/flickr-importer Category:Extensions supporting Composer
License GNU General Public License 3.0 or later
Download Category:Extensions in GitHub version control
CHANGELOG
  • $wgFlickrImporterKey
  • $wgFlickrImporterSecret
Category:All extensionsCategory:Extensions not in ExtensionJson

The FlickrImporter extension allows for importing photos from the social photograph sharing website Flickr.

Installation

  • Download and place the file(s) in a directory called FlickrImporter in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'FlickrImporter' );
    $wgFlickrImporterKey = '<key here>';
    $wgFlickrImporterSecret = '<secret here>';
    
  • Register a new app on Flickr: https://www.flickr.com/services/apps/create/
  • Add your new API key and secret to LocalSettings.php
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage

  1. Log in to MediaWiki, go to your user Preferences page, and click on the 'Misc' section
  2. Click on the 'Connect to Flickr' link, and follow the prompts (you'll be sent to Flickr, asked to authenticate, and then returned to your wiki)
  3. Your Flickr connection will be saved, so you won't have to do this again unless you disconnect
  4. Add your import definitions to User:<Username>/FlickrImporter.json (where <Username> is your username; there's a link to your import page on the Preferences page)

Import definitions are JSON-formatted objects containing the following information:

  1. description: Informative text about this import. Optional.
  2. type: one of: user, group, album, or gallery.
  3. id: ID or username of user; or ID of group, album, or gallery.
  4. privacy: an array of privacy levels (see below). Defaults to 1 just to be safe.
    • 1 public photos (the default)
    • 2 private photos visible to friends
    • 3 private photos visible to family
    • 4 private photos visible to friends & family
    • 5 completely private photos

For example, the complete contents of User:CommonsLover/FlickrImporter.json could be:

[
  {
    "description": "My photos",
    "type": "user",
    "id": "CommonsLover"
  },
  {
    "description": "Wikimedia Commons group",
    "type": "group",
    "id": "30009679@N00"
  }
]

Magic word

This extension adds a new magic word: {{FLICKRID:1234}} that renders as a link to the given photos Flickr page, e.g. <span class="flickr-id">Flickr ID: <a href="https://flic.kr/p/nh">1234</a></span>. The text of the link can be modified via the flickrimporter-flickrid-link system message.

Template

Each photo will be imported and have the following template added to its File page:

{{photo
 | title = 
 | description = 
 | author = 
 | date_taken = 
 | date_taken_granularity = 
 | date_published = 
 | latitude = 
 | longitude = 
 | license = 
 | privacy = 
 | flickr_id = 
}}
Category:Flickr extensions
Category:All extensions Category:Beta status extensions Category:Extensions in GitHub version control Category:Extensions not in ExtensionJson Category:Extensions supporting Composer Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:Extensions without an image Category:Flickr extensions Category:GPL licensed extensions Category:GetPreferences extensions Category:ParserFirstCallInit extensions Category:Parser function extensions Category:Special page extensions