Permalink
Browse files

Removed old and outdated plugins.

  • Loading branch information...
1 parent f717c12 commit 9bb0318949a99fc6c540ab6e725c1b7b0433e6d2 @jk0 committed Jun 27, 2012
View
1 README
@@ -11,7 +11,6 @@ Core Requirements
Plugin Requirements
- launchpadlib
- - pycleverbot
- pywunderground
@@ -1,42 +0,0 @@
-# Copyright 2011 Paul Voccio
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Pyhole Cleverbot Plugin"""
-
-import cleverbot
-
-from pyhole import plugin
-from pyhole import utils
-
-
-class CleverChat(plugin.Plugin):
- """Provide access to the Cleverbot API"""
-
- @plugin.hook_add_command("cleverbot")
- @utils.spawn
- def cleverbot(self, params=None, **kwargs):
- """Chat with the Cleverbot (ex: .chat 'How you doin'?"""
- cb = cleverbot.Session()
- if params:
- try:
- self.irc.reply(cb.Ask(params))
- except KeyError:
- self.irc.reply("Can't chat now. I'm washing my hair.")
- else:
- self.irc.reply(self.chat.__doc__)
-
- @plugin.hook_add_command("cb")
- def alias_cb(self, params=None, **kwargs):
- """Alias of cleverbot"""
- self.cleverbot(params, **kwargs)
View
@@ -1,50 +0,0 @@
-# Copyright 2011 John Dickinson
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Pyhole Dice Plugin"""
-
-import random
-
-from pyhole import plugin
-
-
-class Dice(plugin.Plugin):
- """Provide access to dice games"""
-
- @plugin.hook_add_command("roll")
- def roll(self, params=None, **kwargs):
- """Roll dice (ex: .roll 2d6)"""
- if params:
- query = params.split()[0]
- try:
- if "d" not in query:
- count = 1
- sides = int(query)
- elif query.startswith("d"):
- count = 1
- sides = int(query[1:])
- else:
- count, sides = query.split("d")
- count = int(count)
- sides = int(sides)
- except (TypeError, ValueError):
- result = self.roll.__doc__
- else:
- result = 0
- for _ in xrange(count):
- result += random.randint(1, sides)
- else:
- result = self.roll.__doc__
-
- self.irc.reply(result)
@@ -1,56 +0,0 @@
-# Copyright 2010-2011 Josh Kearney
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Pyhole Entertainment Plugin"""
-
-import re
-
-from BeautifulSoup import BeautifulSoup
-
-from pyhole import plugin
-from pyhole import utils
-
-
-class Entertainment(plugin.Plugin):
- """Provide access to entertaining sites"""
-
- @plugin.hook_add_command("grouphug")
- @utils.spawn
- def grouphug(self, params=None, **kwargs):
- """Display a random Group Hug (ex: .grouphug)"""
- url = "http://grouphug.us/random"
- response = self.irc.fetch_url(url, self.name)
- if not response:
- return
-
- soup = BeautifulSoup(response.read())
- grouphug = utils.decode_entities(
- soup.findAll(id=re.compile("node-\d+"))[2].p.contents[0])
- self.irc.reply(grouphug)
-
- @plugin.hook_add_command("lastnight")
- @utils.spawn
- def lastnight(self, params=None, **kwargs):
- """Display a random Text From Last Night (ex: .lastnight)"""
- url = ("http://www.textsfromlastnight.com/"
- "Random-Texts-From-Last-Night.html")
- response = self.irc.fetch_url(url, self.name)
- if not response:
- return
-
- soup = BeautifulSoup(response.read())
- lastnight = utils.decode_entities(
- soup.findAll(href=re.compile(
- "/Text-Replies-\d+.html"))[0].contents[0])
- self.irc.reply(lastnight)
View
@@ -1,73 +0,0 @@
-# Copyright 2010-2011 Josh Kearney
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Pyhole News Plugin"""
-
-from xml.dom import minidom
-
-from pyhole import plugin
-from pyhole import utils
-
-
-class News(plugin.Plugin):
- """Provide access to news feeds"""
-
- @plugin.hook_add_command("cnn")
- @utils.spawn
- def cnn(self, params=None, **kwargs):
- """Display current CNN news (ex: .cnn)"""
- url = "http://rss.cnn.com/rss/cnn_topstories.rss"
- response = self.irc.fetch_url(url, self.name)
- if not response:
- return
-
- xml = minidom.parseString(response.read())
- for i, item in enumerate(xml.childNodes[2].childNodes[0].childNodes):
- if i >= 21 and i <= 28 and item.childNodes:
- ref = item.childNodes
- self.irc.reply("%s: %s" % (ref[1].firstChild.data,
- ref[5].firstChild.data))
-
- @plugin.hook_add_command("digg")
- @utils.spawn
- def digg(self, params=None, **kwargs):
- """Display current Digg news (ex: .digg)"""
- url = "http://services.digg.com/2.0/story.getTopNews?type=rss"
- response = self.irc.fetch_url(url, self.name)
- if not response:
- return
-
- xml = minidom.parseString(response.read())
- for i, item in enumerate(xml.childNodes[0].childNodes[1].childNodes):
- if i >= 15 and i <= 21 and item.childNodes:
- ref = item.childNodes
- self.irc.reply("%s: %s" % (ref[1].firstChild.data.strip(),
- ref[3].firstChild.data.strip()))
-
- @plugin.hook_add_command("reddit")
- @utils.spawn
- def reddit(self, params=None, **kwargs):
- """Display current reddit news (ex: .reddit)"""
- url = "http://www.reddit.com/.rss"
- response = self.irc.fetch_url(url, self.name)
- if not response:
- return
-
- xml = minidom.parseString(response.read())
- for i, item in enumerate(xml.childNodes[0].childNodes[0].childNodes):
- if i >= 4 and i <= 7:
- ref = item.childNodes
- self.irc.reply("%s: %s" % (
- ref[0].firstChild.data.encode("ascii", "ignore"),
- ref[1].firstChild.data.encode("ascii", "ignore")))
View
@@ -1,4 +1,4 @@
-# Copyright 2011 Josh Kearney
+# Copyright 2011-2012 Josh Kearney
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,4 +1,3 @@
-# Copyright 2010-2011 Josh Kearney
# Copyright 2011 Johannes Erdfelt
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Josh Kearney
+# Copyright 2010-2012 Josh Kearney
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

0 comments on commit 9bb0318

Please sign in to comment.