Class: MediaWiktory::Wikipedia::Actions::Feedwatchlist

Inherits:
Get
  • Object
show all
Defined in:
lib/mediawiktory/wikipedia/actions/feedwatchlist.rb

Overview

Returns a watchlist feed.

Usage:

api.feedwatchlist.feedformat(value).perform # returns string with raw output
# or
api.feedwatchlist.feedformat(value).response # returns output parsed and wrapped into Response object

See Base for generic explanation of working with MediaWiki actions and Response for working with action responses.

All action's parameters are documented as its public methods, see below.

Instance Method Summary collapse

Methods inherited from Get

#perform

Methods inherited from Base

#inspect, #merge, #name, #perform, #response, #to_h, #to_param, #to_url

Methods included from GlobalParams

#assert, #assertuser, #centralauthtoken, #curtimestamp, #errorformat, #errorlang, #errorsuselocal, #format, #maxage, #maxlag, #origin, #requestid, #responselanginfo, #servedby, #smaxage, #uselang

Instance Method Details

#allrevself

Include multiple revisions of the same page within given timeframe.

Returns:

  • (self)


53
54
55
# File 'lib/mediawiktory/wikipedia/actions/feedwatchlist.rb', line 53

def allrev()
  merge(allrev: 'true')
end

#feedformat(value) ⇒ self

The format of the feed.

Parameters:

  • value (String)

    One of "rss", "atom".

Returns:

  • (self)


26
27
28
# File 'lib/mediawiktory/wikipedia/actions/feedwatchlist.rb', line 26

def feedformat(value)
  _feedformat(value) or fail ArgumentError, "Unknown value for feedformat: #{value}"
end

#hours(value) ⇒ self

List pages modified within this many hours from now.

Parameters:

  • value (Integer)

Returns:

  • (self)


39
40
41
# File 'lib/mediawiktory/wikipedia/actions/feedwatchlist.rb', line 39

def hours(value)
  merge(hours: value.to_s)
end

#linktosectionsself

Link directly to changed sections if possible.

Returns:

  • (self)


46
47
48
# File 'lib/mediawiktory/wikipedia/actions/feedwatchlist.rb', line 46

def linktosections()
  merge(linktosections: 'true')
end

#wlexcludeuser(value) ⇒ self

Don't list changes by this user.

Parameters:

  • value (String)

Returns:

  • (self)


103
104
105
# File 'lib/mediawiktory/wikipedia/actions/feedwatchlist.rb', line 103

def wlexcludeuser(value)
  merge(wlexcludeuser: value.to_s)
end

#wlowner(value) ⇒ self

Used along with token to access a different user's watchlist.

Parameters:

  • value (String)

Returns:

  • (self)


61
62
63
# File 'lib/mediawiktory/wikipedia/actions/feedwatchlist.rb', line 61

def wlowner(value)
  merge(wlowner: value.to_s)
end

#wlshow(*values) ⇒ self

Show only items that meet these criteria. For example, to see only minor edits done by logged-in users, set show=minor|!anon.

Parameters:

  • values (Array<String>)

    Allowed values: "minor", "!minor", "bot", "!bot", "anon", "!anon", "patrolled", "!patrolled", "unread", "!unread".

Returns:

  • (self)


77
78
79
# File 'lib/mediawiktory/wikipedia/actions/feedwatchlist.rb', line 77

def wlshow(*values)
  values.inject(self) { |res, val| res._wlshow(val) or fail ArgumentError, "Unknown value for wlshow: #{val}" }
end

#wltoken(value) ⇒ self

A security token (available in the user's preferences) to allow access to another user's watchlist.

Parameters:

  • value (String)

Returns:

  • (self)


69
70
71
# File 'lib/mediawiktory/wikipedia/actions/feedwatchlist.rb', line 69

def wltoken(value)
  merge(wltoken: value.to_s)
end

#wltype(*values) ⇒ self

Which types of changes to show:

Parameters:

  • values (Array<String>)

    Allowed values: "edit" (Regular page edits), "new" (Page creations), "log" (Log entries), "external" (External changes), "categorize" (Category membership changes).

Returns:

  • (self)


90
91
92
# File 'lib/mediawiktory/wikipedia/actions/feedwatchlist.rb', line 90

def wltype(*values)
  values.inject(self) { |res, val| res._wltype(val) or fail ArgumentError, "Unknown value for wltype: #{val}" }
end