mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-25 20:41:19 -05:00
Wikifetch: add wiki.gg fetcher
This commit is contained in:
parent
e7d82053b3
commit
799b7c7b71
@ -155,5 +155,13 @@ class Wikifetch(callbacks.Plugin):
|
||||
baseurl = f'https://{wiki_subdomain}.fandom.com/api.php'
|
||||
self._wiki(irc, baseurl, searchquery)
|
||||
|
||||
@wrap(['somethingWithoutSpaces', 'text'])
|
||||
def wikigg(self, irc, msg, args, wiki_subdomain, searchquery):
|
||||
"""<wiki subdomain> <title>
|
||||
|
||||
Returns the first paragraph of a wiki.gg article.
|
||||
"""
|
||||
baseurl = f'https://{wiki_subdomain}.wiki.gg/api.php'
|
||||
self._wiki(irc, baseurl, searchquery)
|
||||
|
||||
Class = Wikifetch
|
||||
|
@ -58,5 +58,8 @@ if network:
|
||||
self.assertRegexp('fandom minecraft Ender Dragon',
|
||||
r'[Ee]nder [Dd]ragon.*boss')
|
||||
|
||||
self.assertRegexp('fandom terraria Ocean', r'Ocean.*biome')
|
||||
self.assertRegexp('fandom warframe Warframe', r'[Ww]arframe')
|
||||
|
||||
def testWikigg(self):
|
||||
self.assertRegexp('wikigg terraria Ocean',
|
||||
r'Ocean.*biome')
|
||||
|
Loading…
x
Reference in New Issue
Block a user