FANDOM


  • Similar to this request, I'm looking to generate a raw list of files without manually typing each filename down. More specifically, I want to generate the list of files from a specific category (and only this specific category)... I'm assuming this is possible but I'm not sure how ?

    Could it be done with ListFiles or would another script be needed ?

      Loading editor
    • Unfortunately, I looks like that script cannot sort files by category. However, you can still use the underlying data retrieval method to accomplish what you want. Which wiki and category is this for?

        Loading editor
    • You could use DPL. Set namespace, set category, set format to ,/n*[[: ]] or something. Not sure on the exact code for format, am on my phone so can't double check.

        Loading editor
    • Good point; assuming they have DPL enabled. The format would probably be:

      format = ,\n%PAGE%,,
      

      so that they can just copy and past into a text document or something. If they just want the image name without "File:" in front:

      format = ,\n%TITLE%,,
      
        Loading editor
    • {{#dpl:
        |namespace          = File
        |category           = To Be Deleted
        |format             = ,\n* %PAGE%,,
      }}
      

      That should give you a nice bulleted (but unlinked) list that you could easily copy paste into AjaxBatchDelete.

        Loading editor
    • Sorry for the late response, life decided to rear its head !

      That looks good, I'll give it a go, thanks people !


      EDIT: Do I need to ask staff to get DPL enabled on our wiki ?

        Loading editor
    • Demotivator#6
      EDIT: Do I need to ask staff to get DPL enabled on our wiki ?

      DPL is disabled by default, so if you haven't contacted staff to enable DPL, please do so.
        Loading editor
    • If you don't feel like waiting for DPL to be enabled, you could also try either api.php or Special:CategoryTree. Which wiki is this for and what category are you interested in?

        Loading editor
    • Andrewds1021 wrote: If you don't feel like waiting for DPL to be enabled, you could also try either api.php or Special:CategoryTree. Which wiki is this for and what category are you interested in?

      I've requested DPL to be enabled already, but no harm in trying both methods.
      How would I go about with api.php or Special:CategoryTree, and what result should I expect to receive ?

      For the this category on the Kenganverse Wiki.

        Loading editor
    • Here is the basic way of getting the list via api.php. If you want, you can get it in certain formats such as .txt or .json; which may make it easier to strip out the unwanted bits. For example, using the .json:

      1. Open in/copy to a word processor like Microsoft Word
      2. Use find-and-replace to replace "},{"ns":6,"title":" with a newline
        • In Microsoft Word, this is indicated by the special character sequence ^p
      3. Remove the remaining unwanted bits from the start and end of the list
      4. Replace unicode encodings
        • This step is only necessary if some image names use special characters such as &
        • A unicode encoding will start with \u and then have up to 6 (typically 4) hexadecimal digits
          • A hexadecimal digit can be a decimal digit (0-9) or one of the first 6 characters in the basic Latin alphabet (a-f)
        • In Microsoft Word, these can be converted by doing the following
          1. Use find-and-replace to replace \u with U+
          2. For each instance of encoding, place cursor immediately after the last character of the encoding and then press Alt + x

      Using Special:CategoryTree

        Loading editor
    • Thanks all for your help! ^^

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Community content is available under CC-BY-SA unless otherwise noted.