Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
438 lines (425 sloc) 13.8 KB

Copied it from https://github.com/halfak/snuggle/blob/master/config/enwiki.mediawiki.yaml

last_updated: "May 26, 2017" author:

  name: Quinten van der Zanden
  email: quintenvanderzanden@gmail.com
  url: https://www.wikidata.org/wiki/User:QZanden

  1. The name of the MediaWiki installation we're running against.
name: Wikidata

  1. The protocol to use when linking to the MediaWiki web interface. 'https' is
  2. preferred if possible.
protocol: https

  1. The base domain for the MediaWiki installation.
domain: wikidata.org

  1. The path to wiki pages and scripts on the server. This is used for making API
  2. requests and for linking back to the wiki from the the user interface.
path:

  pages: /wiki/
  scripts: /w/

file:

  index: index.php
  api: api.php

  1. Parameters for making requests to the API. Wikidata's API requires that a
  2. header be provided with all requests that identifies the originator of the
  3. request.
requests:

  headers:
    User-Agent: "Snuggle system (see [[:d:WD:Snuggle]])"

  1. String to append at the end of comments for all page edit actions performed.
  2. This is useful for directing other Wikidatans to Snuggle and for tracking
  3. the use of Snuggle across the history of edits in the wiki.
comment_suffix: " (Snuggle)"

  1. Thread traces are how socially relevant actions are recorded. Historically,
  2. the traces of actions relevant to a user and their behavior in Wikidata have
  3. been captured on their talk page. This section specifies a set of traces that
  4. Snuggle will identify and present in the intergace. Each "trace" specifies a
  5. regular expression intended to match the pattern of text that identifies a
  6. wiki trace. Each section of a user's talk page (delimited
  7. by level 2 headers) will be processed and at most one thread trace can be
  8. discovered based on the priority. Priority is determined by order. Traces
  9. that appear first will be prioritized before other traces that could
  10. potentially match.
  11. priority: A list of the keys used below sorted by priority
  12. traces: A map of (key->trace_definition) pairs that describe traces and presentation.
  13. expression: a regular expression to be used to check if the thread matches
  14. the thread type. In most cases, this is looking for something
  15. of the form ""
  16. groups: for each group in the regular expression, the icon can be modified.
  17. Current the only supported operation is to add a superscript.
  18. icon:
  19. display: Text to include within the icon
  20. superscript: (optional) text to include in a superscript of the icon
  21. tooltip: A tooltip that will appear when a user hovers over the trace's
  22. icon in the user interface.
  23. style: css based coloring information to be applied to the icon. Use this
  24. to convey information about the meaning of the trace.
  25. e.g. warnings are black and red and welcomes are green and blue.
talk_threads:

  priority:
    - block
    - vandal warning
    - spam warning
    - copyright warning
    - general warning
    - deletion notification
    - csd notification
    - articles for creation
    - project chat invitation
    - welcome message
  traces:
    block: #####################################################################
      expression: "Template:uw-[a-z0-9]*block"
      groups: []
      icon: 
        label: block
        tooltip: Block notification
        style:
          border-color: "#000"
          background-color: "#ccc"
          box-shadow-color: "#000"
    vandal warning: ############################################################
      expression: "Template:uw-vandalism([0-9]+)?"
      groups:
        - {
          superscript: "%(group)s",
          tooltip: "Vandalism warning -- level %(group)s",
        }
      icon: 
        label: vand
        tooltip: Vandalism warning
        style:
          border-color: "#000"
          background-color: "#f99"
          box-shadow-color: "#000"
    spam warning: ##############################################################
      expression: "Template:uw-spam([0-9]+)?"
      groups:
        - {
          superscript: "%(group)s",
          tooltip: "Spam warning -- level %(group)s",
        }
      icon: 
        label: spam
        tooltip: Spam warning
        style:
          border-color: "#000"
          background-color: "#f99"
          box-shadow-color: "#000"
    copyright warning: #########################################################
      expression: "Template:uw-copyright(-([a-z]+))?([0-9]+)?"
      groups:
        - {} # No one cares
        - {} # No one cares
        - {
          superscript: "%(group)s",
          tooltip: "Copyright warning -- level %(group)s",
        }
      icon:
        label: ©
        tooltip: Copyright warning
        style:
          border-color: "#000"
          background-color: "#dd0"
          box-shadow-color: "#000"
    general warning: ###########################################################
      expression: "Template:uw-"
      groups: [] # No groups in the expression
      icon:
        label: warn
        tooltip: General warning
        style:
          border-color: "#000"
          background-color: "#f99"
          box-shadow-color: "#000"
    deletion notification: #####################################################
      expression: "Template:(proposed del.*?|prod|afd|.*?delet.*?)"
      groups:
        - {} # No one cares
      icon:
        label: del
        tooltip: Notification of deletion proposal
        style:
          border-color: "#aaf"
          background-color: "#fff"
          box-shadow-color: "#aaf"
    csd notification: ##########################################################
      expression: "Template.*?csd|db-|speedy"
      groups: [] # No groups in the expression
      icon: 
        label: csd
        tooltip: Notification of speedy deletion
        style:
          border-color: "#bb0"
          background-color: "#ff0"
          box-shadow-color: "#bb0"
    articles for creation: #####################################################
      expression: "Template:afc"
      groups: [] # No groups in the expression
      icon:
        label: "afc"
        tooltip: Articles for Creation
        style:
          border-color: "#bb0"
          background-color: "#ff0"
          box-shadow-color: "#bb0"
    project chat invitation: #######################################################
      expression: "Template:project chat"
      groups: [] # No groups in the expression
      icon:
        label: TH
        tooltip: Project chat invitation
        style:
          border-color: "#6d6"
          background-color: "#9f9"
          box-shadow-color: "#6d6"
    welcome message: ###########################################################
      expression: "Template:w-[a-z]+|welcome|First article"
      groups: [] # No groups in the expression
      icon:
        label: W
        tooltip: Welcome message
        style:
          border-color: "#66f"
          background-color: "#eef"
          box-shadow-color: "#66f"

  1. User actions represent actions that can be performed on wiki from Snuggle.
  2. A good example of a common action is to post a message on the user's talk
  3. page. The order in which they are listed will determine how they appear in
  4. the user interface.
  5. display: Specifies which actions to display in the user interface. Removing
  6. an action name from this list will effectively disable the action.
  7. actions:
  8. name: The name to be used for this field. This will be used as a label in
  9. the user interface and also as an identifier within the system.
  10. description: the preamble that appears before the form explaining what
  11. action will be taken. Can contain wiki links and references
  12. to the user.
  13. summary: this is used to represent the action taken when presenting the
  14. log of user actions performed. Use %(user)s and %(snuggler)s to
  15. depict where each actor should be referenced.
  16. fields: specifies the components of the form that will be presented in
  17. the UI.
  18. type: the type of form field (text|textarea|select|option|check)
  19. name: the identifier to be used for the form field (important for
  20. string formatting)
  21. label: the label that will appear next to the field in the user
  22. interface.
  23. default: (optional) an optional default value to be set for the
  24. field.
  25. options: (only relevant for radio and select fields) a set of
  26. options for the user to select from.
  27. operations: a set of actions to be performed on the wiki.
user_actions:

  display:
    - send message
    - invite to project chat
    - report abuse
  actions:
    send message:
      label: send message
      description: >
        Posts a new message on 
        [[User:%(user_name)s|]]'s 
        [[User_talk:%(user_name)s|talk page]].
      summary: "%(snuggler)s sent a message to %(user)s"
      fields:
        - # header
          name: header
          label: Header
          type: text
          tooltip: a header for the message
          default: "Hello %(user_name)s"
        - # message
          name: message
          label: Message
          type: textarea
          tooltip: the body of the message
          default: {{subst:Wikidata:Snuggle/Message}} --~~~~
      operations:
        - #Appends the message to the user's talk page
          type: append
          page_name: "User_talk:%(user_name)s"
          markup: "{{subst:Wikidata:Snuggle/User_message|header=%(header)s|message=%(message)s}}"
          comment: "New message: %(header)s"
    invite to project chat:
      label: invite to project chat
      description: >
        Posts an invitation to the [[WD:Project chat]] on 
        [[User:%(user_name)s|%(user_name)s]]'s 
        [[User_talk:%(user_name)s|talk page]].
      summary: "%(snuggler)s invited %(user)s to the project chat"
      fields:
        - # template
          name: template
          label: Template
          type: radio
          tooltip: the template to be used for the invitation.
          default: :Wikidata:Snuggle/Invitation
          options:
            - # Standard invitation
              label: Invitation
              value: :Wikidata:Snuggle/Invitation
              tooltip: The standard invitation template.
            - # Optional other invitiation style
              label: Invitation2
              value: :Wikidata:Snuggle/Invitation2
              tooltip: An alternative invitation template.
        - # header
          name: header
          label: Header
          type: text
          tooltip: a header for the message
          default: "You're invited to the [[WD:Project chat|project chat]]."
        - # message
          name: message
          label: Message
          type: textarea
          tooltip: the body of the message
      operations:
        - # Appends the template to the user's talk page
          type: append
          page_name: "User_talk:%(user_name)s"
          markup: "==%(header)s==\n{{subst%(template)s|message=%(message)s|sign=~~~~}}"
          comment: "%(header)s"
    report abuse:
      label: report abuse
      description: >
        Reports vandals and spammers to admins via the 
        [[WD:AN|Administrators' notice board]]. Use only for
        <b>obvious</b> and <b>persistent</b> cases. Please review
        [[WD:Spam]] and [[WD:Vandalism]].
      summary: "%(snuggler)s reported %(user)s to administrators"
      fields:
        - # reason
          name: reason
          type: "text"
          label: Reason for listing <small>(optional, keep it brief)</small>
          tooltip: the reason that %(user_name)s is being reported
      operations:
        - # Appends a list item to the bottom of AIV
          type: append
          page_name: Administrators'_noticeboard
          markup: "* {{Vandal|%(user_name)s}} %(reason)s ~~~~"
          comment: "Reporting [[User:%(user_name)s]] for %(reason)s"

  1. Namespaces are configurable for MediaWiki installations. This datastructure
  2. describes the configuration of Wikidata. Note that the Main
  3. namespace has an empty prefix
namespaces:

  -2:
    name: Media
    prefixes:
      - "Media:"
  -1:
    name: Special
    prefixes:
      - "Special:"
  0:
    name: Items
    prefixes:
      - ""
  1:
    name: Talk
    prefixes:
      - "Talk:"
  2:
    name: User
    prefixes:
      - "User:"
  3:
    name: User talk
    prefixes:
      - "User_talk:"
  4:
    name: Wikidata
    prefixes:
      - "Wikidata:"
      - "Project:"
      - "WD:"
  5:
    name: Wikidata_talk
    prefixes:
      - "Wikipdata_talk:"
      - "Project_talk:"
      - "WT:"
  6:
    name: File
    prefixes:
      - "File:"
      - "Image:"
  7:
    name: File_talk
    prefixes:
      - "File_talk:"
      - "Image_talk:"
  8:
    name: Mediawiki
    prefixes:
      - "Mediawiki:"
      - "MediaWiki:"
  9:
    name: Mediawiki_talk
    prefixes:
      - "Mediawiki_talk:"
      - "MediaWiki_talk:"
  10:
    name: Template
    prefixes:
      - "Template:"
  11:
    name: Template_talk
    prefixes:
      - "Template_talk:"
  12:
    name: Help
    prefixes:
      - "Help:"
  13:
    name: Help_talk
    prefixes:
      - "Help_talk:"
  14:
    name: Category
    prefixes:
      - "Category:"
  15:
    name: Category_talk
    prefixes:
      - "Category_talk:"
  100:
    name: Portal
    prefixes:
      - "Portal:"
  101:
    name: Portal_talk
    prefixes:
      - "Portal_talk:"
  108:
    name: Book
    prefixes:
      - "Book:"
  446:
    name: Education_program
    prefixes:
      - "Education_program:"
  447:
    name: Education_program_talk
    prefixes:
      - "Education_program_talk:"
  710:
    name: Timedtext
    prefixes:
      - "Timedtext:"
  711:
    name: Timedtext_talk
    prefixes:
      - "Timedtext_talk:"
  828:
    name: Module
    prefixes:
      - "Module:"
  829:
    name: Module_talk
    prefixes:
      - "Module_talk:"