-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
As a non-windows user, but still a lazy person, I had to reverse engineer the API. It boiled down to
#!/bin/bash
set -euo pipefail
apiKey="${1}"
luaFile="${2}"
curl \
--user-agent "WoWthing Sync" \
--header "Content-Type: application/json" \
--header "Content-Encoding: gzip" \
--data-binary @<(jq --raw-output \
--arg data "$(cat "${luaFile}")" \
--arg apikey "${apiKey}" \
'{"LuaFile": $data, "ApiKey": $apikey}' <<<'{}' | \
gzip) \
https://wowthing.org/api/uploadi.e.
/upload
- Requires Content-Type
application/json. - Requires Content-Encoding
gzip. - Content shall be a json blob with
{"LuaFile": …, "ApiKey": …}whereLuaFileis theWoWthing_Collector.luafile content.ApiKeyis found in your account's settings page.
I feel this should probably be in some by-default-hidden block on the /upload page. No real need in hiding it.
One could engineer this into a docker container with inotify-watch for the lua file etc to have a platform-agonistic sync application, but meh. I personally will just manually run it every once in a while. To me, documenting the API somewhere would be enough.
Of course, dumping the above script in this repo is also a good thing for people like me.
Evonder, jirihofman and sychevyi
Metadata
Metadata
Assignees
Labels
No labels