Jump to content

Extension:LiquidThreads/API

From mediawiki.org

LiquidThreads adds a 'threads' list module to retrieve thread details.

Parameters

  • thstartid: The thread id to start enumerating from
  • thendid: The thread id to stop enumerating at
  • thdir: The direction in which to enumerate (older, newer)
  • thshowdeleted: Whether or not to show deleted threads.
  • thlimit: The maximum number of threads to list
  • thprop: Which properties to get
  • thpage: Limit results to threads on a particular page(s)
  • thauthor: Limit results to threads by a particular author(s)
  • throot: Limit results to threads with the given root(s)
  • thsummary: Limit results to threads corresponding to the given summary page(s)
  • thid: Get threads with the given ID(s)
  • thrender: Whether to include the rendered thread in the results.
  • threnderlevel: When rendering, the level at which to start (for the sake of depth limits, etc.).
  • threnderthreadpos: When rendering, the position of the thread in the group of threads being rendered at that level (affects display somewhat).
  • threnderthreadcount: When rendering, the number of threads in that level group.
  • threndermaxthreadcount: When rendering, the maximum number of replies to show before adding a "Show more replies" link.
  • threndermaxdepth: When rendering, the maximum depth of replies to show before showing a "Show X replies" link instead of replies.
  • threnderstartrepliesat: When rendering, the point at which to start showing replies (used internally to load extra replies).

Example

Get details of all threads on "Talk:Xpd" page.
Result
{
    "batchcomplete": "",
    "continue": {
        "thstartid": "36",
        "continue": "-||"
    },
    "query": {
        "threads": {
            "15": {
                "id": "15",
                "subject": "Subject Test",
                "pagens": 1,
                "pagetitle": "Talk:Xpd",
                "parent": null,
                "author": {
                    "id": "1615",
                    "name": "AKlapper (WMF)"
                }
            },
            "16": {
                "id": "16",
                "subject": "Subject Test",
                "pagens": 1,
                "pagetitle": "Talk:Xpd",
                "parent": "15",
                "author": {
                    "id": "1185",
                    "name": "Malyacko"
                }
            },
            "17": {
                "id": "17",
                "subject": "Starting a new discussion?",
                "pagens": 1,
                "pagetitle": "Talk:Xpd",
                "parent": null,
                "author": {
                    "id": "1378",
                    "name": "Valeriej"
                }
            },
            "25": {
                "id": "25",
                "subject": "Subject Test",
                "pagens": 1,
                "pagetitle": "Talk:Xpd",
                "parent": "15",
                "author": {
                    "id": "268",
                    "name": "MarkAHershberger"
                }
            },
            "26": {
                "id": "26",
                "subject": "Subject Test",
                "pagens": 1,
                "pagetitle": "Talk:Xpd",
                "parent": "25",
                "author": {
                    "id": "268",
                    "name": "MarkAHershberger"
                }
            },
            "27": {
                "id": "27",
                "subject": "Subject Test",
                "pagens": 1,
                "pagetitle": "Talk:Xpd",
                "parent": "26",
                "author": {
                    "id": "268",
                    "name": "MarkAHershberger"
                }
            },
            "28": {
                "id": "28",
                "subject": "Another Test Thread",
                "pagens": 1,
                "pagetitle": "Talk:Xpd",
                "parent": null,
                "author": {
                    "id": "1378",
                    "name": "Valeriej"
                }
            },
            "30": {
                "id": "30",
                "subject": "Another Test Thread",
                "pagens": 1,
                "pagetitle": "Talk:Xpd",
                "parent": "28",
                "author": {
                    "id": "1378",
                    "name": "Valeriej"
                }
            },
            "32": {
                "id": "32",
                "subject": "Another Test Thread",
                "pagens": 1,
                "pagetitle": "Talk:Xpd",
                "parent": "30",
                "author": {
                    "id": "1378",
                    "name": "Valeriej"
                }
            },
            "35": {
                "id": "35",
                "subject": "Another Test Thread",
                "pagens": 1,
                "pagetitle": "Talk:Xpd",
                "parent": "32",
                "author": {
                    "id": "1378",
                    "name": "Valeriej"
                }
            }
        }
    }
}

Feedthreads

[edit]

This module returns a feed of discussion threads

Parameters

[edit]
  • days – Number of days of threads to show. Type: integer
  • feedformat – The format of the feed.
Type: one of rss, atom
  • talkpage – Limit results to threads on these talk pages.
  • thread – Limit results to these threads and their descendants.
  • type – Types of posts to show.
Type: one of replies, newthreads


action=feedthreads

(main | feedthreads)
  • This module requires read rights.
  • Source: Liquid Threads
  • License: GPL-2.0-or-later

Return a feed of discussion threads.

Specific parameters:
Other general parameters are available.
feedformat

The format of the feed.

One of the following values: atom, rss
Default: rss
days

Number of days of threads to show.

Type: integer
The value must be between 1 and 30.
Default: 7
type

Types of posts to show.

Values (separate with | or alternative): newthreads, replies
Default: newthreads
talkpage

Limit results to threads on these talk pages.

Separate values with | or alternative.
Maximum number of values is 50 (500 for clients that are allowed higher limits).
thread

Limit results to these threads and their descendants.

Separate values with | or alternative.
Maximum number of values is 50 (500 for clients that are allowed higher limits).


Threadaction

[edit]


action=threadaction

(main | threadaction)
  • This module requires read rights.
  • This module requires write rights.
  • This module only accepts POST requests.
  • Source: Liquid Threads
  • License: GPL-2.0-or-later

Allows actions to be taken on threads and posts in threaded discussions.

Specific parameters:
Other general parameters are available.
thread

Thread IDs or titles to act on.

Separate values with | or alternative.
Maximum number of values is 50 (500 for clients that are allowed higher limits).
talkpage

The talkpage to act on (if applicable).

threadaction

The action to take.

This parameter is required.
One of the following values: addreaction, deletereaction, edit, inlineeditform, markread, markunread, merge, newthread, reply, setsortkey, setsubject, split
token

A "csrf" token retrieved from action=query&meta=tokens

This parameter is required.
subject

The subject to set for the new or split thread.

reason

If applicable, the reason/summary for the action.

newparent

If merging a thread, the ID or title for its new parent.

text

The text of the post to create.

render

On post and reply methods, the top-level thread after the change will be rendered and returned in the result.

bump

Overrides default behavior as to whether or not to.

sortkey

Specifies the timestamp to which to set a thread's sort key. May be "now".

signature

Specifies the signature to use for that post, instead of the default.

type

Specifies the type of reaction to add.

value

Specifies the value associated with the reaction to add.

method

For getting inline edit forms, the method to get a form for.

operand

(no description)

captchaword

Answer to the CAPTCHA

captchaid

CAPTCHA ID from previous request