module MediaWiktory::Wikipedia::Modules::Extlinks
Returns all external URLs (not interwikis) from the given pages.
The “submodule” (MediaWiki API term) is included in action after setting some param, providing additional tweaking for this param. Example (for {MediaWiktory::Wikipedia::Actions::Query} and its submodules):
“`ruby api.query # returns Actions::Query
.prop(:revisions) # adds prop=revisions to action URL, and includes Modules::Revisions into action .limit(10) # method of Modules::Revisions, adds rvlimit=10 to URL
“`
All submodule's parameters are documented as its public methods, see below.
Public Instance Methods
@private
# File lib/mediawiktory/wikipedia/modules/extlinks.rb, line 46 def _protocol(value) defined?(super) && super || ["bitcoin", "ftp", "ftps", "geo", "git", "gopher", "http", "https", "irc", "ircs", "magnet", "mailto", "mms", "news", "nntp", "redis", "sftp", "sip", "sips", "sms", "ssh", "svn", "tel", "telnet", "urn", "worldwind", "xmpp"].include?(value.to_s) && merge(elprotocol: value.to_s) end
Expand protocol-relative URLs with the canonical protocol.
@return [self]
# File lib/mediawiktory/wikipedia/modules/extlinks.rb, line 61 def expandurl() merge(elexpandurl: 'true') end
How many links to return.
@param value [Integer, “max”] @return [self]
# File lib/mediawiktory/wikipedia/modules/extlinks.rb, line 25 def limit(value) merge(ellimit: value.to_s) end
When more results are available, use this to continue.
@param value [Integer] @return [self]
# File lib/mediawiktory/wikipedia/modules/extlinks.rb, line 33 def offset(value) merge(eloffset: value.to_s) end
Protocol of the URL. If empty and elquery is set, the protocol is http. Leave both this and elquery empty to list all external links.
@param value [String] One of “bitcoin”, “ftp”, “ftps”, “geo”, “git”, “gopher”, “http”, “https”, “irc”, “ircs”, “magnet”, “mailto”, “mms”, “news”, “nntp”, “redis”, “sftp”, “sip”, “sips”, “sms”, “ssh”, “svn”, “tel”, “telnet”, “urn”, “worldwind”, “xmpp”. @return [self]
# File lib/mediawiktory/wikipedia/modules/extlinks.rb, line 41 def protocol(value) _protocol(value) or fail ArgumentError, "Unknown value for protocol: #{value}" end
Search
string without protocol. Useful for checking whether a certain page contains a certain external url.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/modules/extlinks.rb, line 54 def query(value) merge(elquery: value.to_s) end