ListFilesは、ファイル管理のためのサイト全体およびユーザースクリプトです。MediaWiki APIに問い合わせるためのURLを作成するためのフォームと、取得後のデータをフォーマットするための広範囲なオプションを提供します。 このスクリプトでできること
- wiki上のすべてのファイルをアルファベット順に並べる事
- ある接頭辞を持つすべてのファイルを検索する事
- 1MB以上のファイルのリストを取得する事
- ページを再読み込みせずに新しいリストを生成する事
- 設定の保存とリセットを行える事
- ファイルを、名前、アップローダ、タイムスタンプ、幅などでソートする事
そして生のテキストで生成されたリストを解析し、ボットなどの他のアプリケーションで使用することができます。このスクリプトで、できないことは以下の通りです。
- 最近アップロードされたすべてのファイルを簡単に見つける (代わりに Special:NewFiles の特別ページを使用してください)
- wiki上のすべての.png画像を見つける。
aimimeパラメータは、mimeタイプでファイルを検索するために使用することができます...
しかし、残念ながらそれはサーバーに負担をかけるものであり、Fandom全体で無効になっています。
Some things you cannot do with this script are:
- easily find all files uploaded recently (use the Special:NewFiles special page instead)
- find all .png images on a wiki. The
aimimeparameter could be used to search for files by mime type... but unfortunately it's server-intensive and is disabled across Fandom.
Installation[]
Usage[]
ListFilesスクリプトがインストールされると、wikiのProject:ListFilesにアクセスして、スクリプトの動作を確認することができます。このスクリプトは、タイトルに「ListFiles」が含まれるUser: 名前空間のサブページにもロードされます(例:User:Username/ListFiles)。
このスクリプトを別のページで強制的に読み込ませたい場合は、好きなページを編集して、次のようなwikitextを配置してください。
<div id="ListFiles-container">このページは、MediaWiki APIに画像を問い合わせるためのフォームを提供しており、機能するためにはJavaScriptが必要です。詳しくは[[w:c:dev:ListFiles|ListFiles]]をご覧ください</div>
id="ListFiles-container"の部分が重要な部分です。ListFilesスクリプトは、そのidを持つコンテナを探しますので、そのようなコンテナを任意のページに配置すれば、そのページでスクリプトが実行されます。
ファイル名のリスト(生データ)[]
このスクリプトの副次的な機能として、以下の特設ページでファイル名のリストを生テキストで提供しています。
これらの生のテキストリストは、ボットや自動化スクリプトを持つ人にとって便利です。例えば、wikiで使われていない画像を削除したい場合、Special:UnusedFilesにアクセスして、このスクリプトが提供するファイルの生のテキストリストをコピーし、その入力をAjaxBatchDeleteスクリプトに通して、簡単に大量削除することができます。
Changelog[]
- 6 July 2017
- Game Moderator prevented distorting the image, and perfectly aligns it in the center on hover.
- 02 January 2017
- Dai ca superman added AjaxRC support for script.
- 23 January 2014
- ShutterBat started translation in spanish of code (raw filenames by the moment specially for advanced version of QuickTools).
- 7 February 2013
- Mathmagician extended the "raw list of filenames" feature to Special:UncategorizedFiles, thanks to Revitalizer's note on the talk page.
- 2 February 2013
- Mathmagician extended the "raw list of filenames" feature to the new Special:UnusedVideos page.
- 29 January 2013
- Mathmagician added feature for raw list of filenames at Special:UnusedImages (helpful for people who want to do a batch delete to clean up unused files).
- 30 October 2012
- Mathmagician added feature for raw list of filenames at Special:ListFiles (convenient way to get a list of all files uploaded by a single user).
- 22 October 2012
- Mathmagician added an image preview feature when hovering over filename links in the results table.
- 25 September 2012
- Mathmagician created.