Remove hard-coded API key from the library.

This commit is contained in:
Jason R. Coombs 2016-01-18 16:07:31 -05:00
parent 5252514c87
commit 5fc802f6e7
2 changed files with 11 additions and 1 deletions

View File

@ -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
<https://developer.wolframalpha.com>`_.
1.4 1.4
=== ===

View File

@ -1,12 +1,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import absolute_import from __future__ import absolute_import
import pmxbot
from pmxbot.core import command from pmxbot.core import command
import wolframalpha import wolframalpha
@command("wolframalpha", aliases=('wa',), doc="Wolfram Alpha rules") @command("wolframalpha", aliases=('wa',), doc="Wolfram Alpha rules")
def wa(client, event, channel, nick, rest): 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) res = client.query(rest)
return next(res.results).text return next(res.results).text