From 5fc802f6e7a3b50074f04c37990ebaf6a7fec963 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 18 Jan 2016 16:07:31 -0500 Subject: [PATCH] Remove hard-coded API key from the library. --- CHANGES.rst | 9 +++++++++ wolframalpha/pmxbot.py | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 7553131..2db98ef 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,12 @@ +2.0 +=== + +``pmxbot`` plugin now requires that the "Wolfram|Alpha API key" +config parameter be supplied. The hard-coded key has been +removed and will be de-activated. Users must register for their +own key at the `Wolfram|Alpha developer web site +`_. + 1.4 === diff --git a/wolframalpha/pmxbot.py b/wolframalpha/pmxbot.py index e76ddfe..eda64a9 100644 --- a/wolframalpha/pmxbot.py +++ b/wolframalpha/pmxbot.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import +import pmxbot from pmxbot.core import command import wolframalpha @command("wolframalpha", aliases=('wa',), doc="Wolfram Alpha rules") def wa(client, event, channel, nick, rest): - client = wolframalpha.Client('Q59EW4-UEL27J79UK') + client = wolframalpha.Client(pmxbot.config['Wolfram|Alpha API key']) res = client.query(rest) return next(res.results).text