Class: WatchstarGateway

WatchstarGateway(api)

new WatchstarGateway(api)

API for retrieving and modifying page watch statuses. This module interacts with two endpoints, API:Info for GETs and API:Watch and for POSTs.

Parameters:
Name Type Description
api mw.Api
Source:

Methods

_unmarshalGetResponse(rsp) → {jQuery.Deferred.<WatchStatusMap>}

Parameters:
Name Type Description
rsp Object

The API:Info response.

Source:
See:
  • getStatusesByID
  • getStatusesByTitle
Returns:
Type
jQuery.Deferred.<WatchStatusMap>

getStatuses(ids, titles) → {jQuery.Deferred.<WatchStatusMap>}

Issues zero to two asynchronous HTTP requests for the watch status of each page ID and title passed.

Every watch entry has a title but not necessarily a page ID. Entries without IDs are missing pages, i.e., pages that do not exist. These entries are used to observe when a page with a given title is created. Although it is convenient to use titles because they're always present, IDs are preferred since they're far less likely to exceed the URL length limit.

No request is issued when no IDs and no titles are passed. Given that the server state does not change between the two requests, overlapping title and ID members will behave as expected but there is no reason to issue such a request.

Parameters:
Name Type Description
ids Array.<PageID>
titles Array.<PageTitle>
Source:
Returns:
Type
jQuery.Deferred.<WatchStatusMap>

getStatusesByID(ids) → {jQuery.Deferred.<WatchStatusMap>}

Parameters:
Name Type Description
ids Array.<PageID>
Source:
Returns:
Type
jQuery.Deferred.<WatchStatusMap>

getStatusesByTitle(titles) → {jQuery.Deferred.<WatchStatusMap>}

Parameters:
Name Type Description
titles Array.<PageTitle>
Source:
Returns:
Type
jQuery.Deferred.<WatchStatusMap>

postStatusesByTitle(titles, watched) → {jQuery.Deferred}

Parameters:
Name Type Description
titles Array.<PageTitle>
watched WatchStatus
Source:
Returns:
Type
jQuery.Deferred