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

Add xkcd command #2

Merged
merged 1 commit into from Nov 10, 2019

Conversation

@groowyCZ
Copy link
Contributor

groowyCZ commented Nov 7, 2019

No description provided.

elif comic_id == "latest":
base_url += "?new"

async with self._http_session.get("http://wa.funsite.cz/xkcd/") as resp:

This comment has been minimized.

Copy link
@KazWolfe

KazWolfe Nov 10, 2019

Owner

Please use SSL connections for all outbound traffic.


comic = await resp.json()

if not "image" in comic.keys():

This comment has been minimized.

Copy link
@KazWolfe

KazWolfe Nov 10, 2019

Owner

Checking for the existence of image like this is expensive computationally. You can use image in comic instead for a slight performance boost: https://docs.python.org/3/library/stdtypes.html#dict

This is a non-blocking issue, I'll accept this PR without it, but pointing out for future reference :)

@KazWolfe KazWolfe merged commit 25d170c into KazWolfe:master Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.