Hi there! excited that you are interested in working with the Twitter API, welcome to our community!
The example you found is several years old, and unfortunately it is not as simple to do this any more. As the Twitter API has evolved, we have added the ability to upload video, GIFs etc so the path for posting images with Tweets now has two major steps:
- upload media
- post Tweet, with the media attached.
This means it is not possible to do this in a single line of cURL commands.
We have a Twitter-oriented tool, similar to cURL, which is called twurl - this may be a better tool for doing this.