Closed
Conversation
intends to fix nasa#126 Signed-off-by: rooot <hey@rooot.gay>
Signed-off-by: rooot <hey@rooot.gay>
Author
|
small side note: the way I got nosetest to install and work was by running |
Author
|
another thing I noticed: some (recent?) images return extra text in the explanation field than they're supposed to, like today's APOD:
been considering either making another PR for this, or just having this PR fix that too |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR intends to fix #126, preventing lack of copyright information from the API.
I've made quite a few changes to copyright parsing, trying to not break parsing older APODs - i manually verified parsing for a few older ones, and it doesn't seem to break any.
It also cleans up the copyright line before returning it in the 2nd copyright parsing attempt, preventing double spaces and weird/unnecessary newlines (
\n) and double/triple spaces (,).it also checks for explicit NASA credit - if no mentions of "copyright" or "license" have been found in the image credits, and NASA is explicitly credited, it assumes the image to be Public Domain and skips returning copyright information.
i also thought about introducing a "credits" line, specifically for cases like this, where there's no specific license/copyright information present but you still want to attribute the source of the image properly.
feedback is very much appreciated!
side note: the code might not be the best, i don't usually write python, but i tried to document it well enough for others to be able to understand it :3