Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISBNdb Plugin #265

Merged
merged 6 commits into from
Dec 10, 2018
Merged

ISBNdb Plugin #265

merged 6 commits into from
Dec 10, 2018

Conversation

K0HAX
Copy link
Contributor

@K0HAX K0HAX commented Apr 10, 2017

I created a plugin to allow users to type ".isbn " and return information about the book from http://isbndb.com.

@K0HAX K0HAX changed the base branch from master to python3.4 April 11, 2017 14:26
@K0HAX K0HAX changed the base branch from python3.4 to master April 11, 2017 14:28
plugins/isbn.py Outdated
@@ -0,0 +1,45 @@
import re
import json, requests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to import json as requests has a built in json method.

plugins/isbn.py Outdated
url = url + book
#print(url)
resp = requests.get(url=url)
data = json.loads(resp.text)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be changed to

data = resp.json()

@knight-ryu12
Copy link
Contributor

knight-ryu12 commented Apr 17, 2017 via email

@daboross
Copy link
Contributor

Requests has that built in though, with the response.json() method - no need to depend directly on json?

Removed the json library from requirements.txt as it is not required.
@K0HAX
Copy link
Contributor Author

K0HAX commented Apr 20, 2017

I just pushed an update using response.json(), I've tested that method and it worked.

@daboross daboross merged commit e777739 into CloudBotIRC:master Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants