@prologic@twtxt.net - I do not want to nag about it - but did you find some way to post image through curl? (Or could you share the almost-working solution that you tried?), if you have not had time - then that’s fine too. I want to start looking into it again :)

⤋ Read More

@stigatle@yarn.stigatle.no Yeah sorry about that! Here’s how to do it!

$ curl -F media_file=@gitea.png -H "Token: $YARND_TOKEN" https://twtxt.net/api/v1/upload
{"Type":"taskURI","Path":"https://twtxt.net/task/FiBmMQbNF7bicLSZsWybmN"}
$ curl https://twtxt.net/task/FiBmMQbNF7bicLSZsWybmN | jq '.'
{
  "state": "complete",
  "error": "",
  "data": {
    "mediaURI": "https://twtxt.net/media/rhkm36YACemg7TBmG7d2Q6.png"
  }
}

⤋ Read More

Basically:

  1. Hit the /api/v1/upload endpoint with a valid token and media_file as a Form URL encoded payload.
  2. Hit the Task endpoint you get back until status=complete
  3. Use the URI once complete

⤋ Read More

@prologic@twtxt.net I do that now, and all that works, it’s just that I do not (currently) check it multiple times, in the test I did it completed as soon as the image was uploaded. But yeah I have to do some more with that for bigger files for sure. I’ll look into that next.

⤋ Read More

I had some time to code this afternoon, so I have made some polling now, so if a task is not completed it waits 2 secs and tries again, if the server reports a error in the task it stops polling, when the task is successfull it will add the resulting image tag to the status input field. Quite pleased with this now. After this I’ll work on ‘view conversation’, meanning you can open a conversation and see all posts in it, that’ll make it even easier to follow conversations and to reply etc.

⤋ Read More

Participate

Login to join in on this yarn.