From c55998bfc1b7cd726413d423ae8834be65d3f609 Mon Sep 17 00:00:00 2001 From: Peter Ajamian Date: Wed, 14 Aug 2019 15:32:19 +1200 Subject: [PATCH] Add hastebin support --- __init__.py | 2 +- plugin.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 3efb517..dbef5aa 100644 --- a/__init__.py +++ b/__init__.py @@ -38,7 +38,7 @@ from supybot import world # Use this for the version of this plugin. You may wish to put a CVS keyword # in here if you're keeping the plugin in CVS or some similar system. -__version__ = "0.2" +__version__ = "0.3" # XXX Replace this with an appropriate author or supybot.Author instance. __author__ = supybot.Author('Peter Ajamian', 'pj', 'peter@pajamian.dhs.org') diff --git a/plugin.py b/plugin.py index d47f253..4744385 100644 --- a/plugin.py +++ b/plugin.py @@ -56,9 +56,14 @@ class Pastebin2cpaste(callbacks.Plugin): 'paste.fedoraproject.org': { 'regex': re.compile(r'([0-9a-zA-Z~-]+)(?:/raw)?[.:?!,]*$'), 'url': 'https://paste.fedoraproject.org/paste/%s/raw' + }, + 'hastebin.com': { + 'regex': re.compile(r'/([a-z]+)(?:\.[a-z]+)?[.:?!,]*$'), + 'url': 'https://hastebin.com/raw/%s' } } + def doPrivmsg(self, irc, msg): if ircmsgs.isCtcp(msg) and not ircmsgs.isAction(msg): return