XKCD icon indicating copy to clipboard operation
XKCD copied to clipboard

Added function to print comic information to STDOUT

Open taylor85345 opened this issue 2 years ago • 5 comments

I thought it would be nice to have comic information (Title, Publish Date, Number, and Alt Text) written to the terminal output. Sorry if there's a better way to do this, it's the first time I've ever touched Python code.

taylor85345 avatar Jan 13 '22 16:01 taylor85345

Might be cool to offer it as an option to forgo the popup i.e. just get that metadata.

I tried to make the data optional, but again it's my first time touching python and I didn't have any luck adding the necessary flag

EDIT: Also, would foregoing the pop-up make sense in combination with the --random flag? I feel like a random comic would be the most important place to have at least the comic number printed.

taylor85345 avatar Jan 13 '22 18:01 taylor85345

Ok, I figured it out. I've added the flags --metadata to trigger printing metadata to STDOUT, and --noimage to optionally suppress display of the comic.

taylor85345 avatar Jan 13 '22 19:01 taylor85345

Maybe at least print the comic number no matter what? That would make issues like #8 reproducible.

TheTechRobo avatar Jan 13 '22 23:01 TheTechRobo

This is great for your first time with Python btw! The only stuff I wrote back then was garbage

TheTechRobo avatar Jan 13 '22 23:01 TheTechRobo

Done!

And Thanks. I'm reasonably competent with bash script, so I've got the basic scripting logic, and it's mostly just extrapolating from what's already there to get the syntax. I appreciate the feedback!

taylor85345 avatar Jan 14 '22 01:01 taylor85345