From bac52dfb11ff9709eac08e1dc7231dc8055b8f63 Mon Sep 17 00:00:00 2001 From: "Sean B. Palmer" Date: Sat, 7 Jul 2012 18:30:23 +0100 Subject: Added a simple twitter module --- modules/search.py | 2 ++ modules/twitter.py | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100755 modules/twitter.py diff --git a/modules/search.py b/modules/search.py index 13fadbb..b884d1c 100755 --- a/modules/search.py +++ b/modules/search.py @@ -119,6 +119,8 @@ def bing_search(query, lang='en-GB'): def bing(phenny, input): """Queries Bing for the specified input.""" + return phenny.reply("Sorry, .bing is disabled pending a QA review.") + query = input.group(2) if query.startswith(':'): lang, query = query.split(' ', 1) diff --git a/modules/twitter.py b/modules/twitter.py new file mode 100755 index 0000000..132d5cb --- /dev/null +++ b/modules/twitter.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +""" +twitter.py - Phenny Twitter Module +Copyright 2012, Sean B. Palmer, inamidst.com +Licensed under the Eiffel Forum License 2. + +http://inamidst.com/phenny/ +""" + +import re, time +import web + +r_username = re.compile(r'^[a-zA-Z0-9_]{1,15}$') +r_link = re.compile(r'^https?://twitter.com/\S+$') +r_p = re.compile(r'(?ims)(