User:HYanWong

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Automatic credit (attribution) lines[edit]

The following code generates credit lines for images on Commons (a bit like Gadget-Stockphoto but designed for batch processing large numbers of images).

You give the script a list of image names, or a search pattern, and it slurps through the entire commons-pages-articles xml dump looking for matching pages, tries to recognise authors from those pages, then grabs the licences by looking through a (parsed) copy of the commonswiki categorylinks sql table.

You first need to download the sql file, unzip it, and run this simple C program to pre-parse it into a text-readable form. You can then download and unpack the commons xml dump, and run my script from the command line, something like

./imagenames2credits.pl list_of_images.txt commonswiki-latest-pages-articles.xml commonswiki-latest-categorylinks.sql outputCreditLines.txt

The perl script is available at User:HYanWong/imagenames2credits.pl.

Test[edit]

Note: This information is taken from [[:{{subst:FULLPAGENAME}}]]


DomainEukaryota • RegnumAnimalia • SubregnumEumetazoa • CladusBilateria • SuperphylumProtostomia • CladusEcdysozoa • PhylumArthropoda • SubphylumCrustacea • ClassisMalacostraca • SubclassisEumalacostraca • SuperordoEucarida • OrdoDecapoda • SubordoPleocyemata • InfraordoCaridea Dana, 1852
  • EnglishShrimp
  • polski: Krewetki
  • português: Camarão
(Note: no wikidata item is associated with this user)