This repository has been archived by the owner on Nov 19, 2021. It is now read-only.
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.
I've done some work to make this work with the new LocalWiki and API v4. I've never written Ruby before, so this is a bit messy, but it appears to work in the cases I've tested it with.
The main functional difference is that posts are no longer made from the user's account and are instead made directly by the user associated with the main API key. This is because I do not yet see a way to securely allow the previous behavior: we can adapt the LocalWiki backend to allow superusers with API keys to post as any user (perhaps using a custom header), but the problem is that there is no way to authenticate the underlying email address, because email addresses can be so easily spoofed.
But this update should bring the script up to functioning status. It may need some polish, though. Other things worth looking at if this script is further developed:
POST
to an endpoint with an image and some HTML and have all of the EXIF, etc stuff taken care of automatically./maps
, but i figure in this case this is the fastest way to get this running right now.