palewire / archiveis

A simple Python wrapper for the archive.is capturing service
https://archive.is
MIT License
184 stars 16 forks source link

Split post logic and memento parsing into separate functions #12

Closed tkelman closed 4 years ago

tkelman commented 4 years ago

And allow specifying the anyway flag in case you want to retrieve existing archives instead of always creating a new one.

I have a use case where I want to inspect the most-recently-archived date, but don't care much about the URL. Working directly with the POST response object would be easier for me than downloading the same content over again.

tkelman commented 4 years ago

Would be happy to get your opinion on this refactor @palewire. This would conflict a little with @adbar's #11 but not in any irreconcilable ways.

palewire commented 4 years ago

I'm okay with splitting the functions but I'd prefer not to do the anyway thing. Seems a little hacky for my taste. Could we insert an error to be raised or some kind of warning log you could catch to handle it on your end?

tkelman commented 4 years ago

Do you have any other proposal for a way to retrieve existing archives? I don't want to unconditionally submit a new one all of the time, I'd like to check the status first. The anyway flag accomplishes that - it's pretty harmless to make the flag user specifiable as long as the default doesn't change, can you clarify what you find objectionable about it?

tkelman commented 4 years ago

I can't get the desired behavior for some of my calls to this function with anyway hardcoded to 1. There's no exceptions or log parsing that can do the same thing, I need the option of sending a different value in the post payload.