Skip to content

Instantly share code, notes, and snippets.

@dewomser
Last active May 22, 2023 22:09
Show Gist options
  • Save dewomser/2e77c0abef6a1af8a86384111445e54a to your computer and use it in GitHub Desktop.
Save dewomser/2e77c0abef6a1af8a86384111445e54a to your computer and use it in GitHub Desktop.
Achtung dieses Script benutzt twurl . Twurl wurde von Twitter abgeschaltet. Funktioniert nicht mehr
# Twurl wurde im Mai 2023 von Twitter abgeschaltet. Funktioniert nicht mehr!
#!/bin/bash
byte="$(du -b test.png | cut -b -5)"
user="twitteruser"
## // initialisieren mit genauer Byte größe
mis=$(twurl -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "command=INIT&media_type=image/jpg&total_bytes=$byte" | jq .media_id_string)
mis="${mis:1: -1}"
#//hochladen
twurl -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "command=APPEND&media_id=$mis&segment_index=0" --file test.png --file-field "media" | jq
#//finalisieren
twurl -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "command=FINALIZE&media_id=$mis" | jq
#//text hinzufügen
twurl -u $user "/1.1/statuses/update.json" -d "media_ids=$mis&status=Sample Tweet with media_ids and twurl. Ein Bashscript"
@dewomser
Copy link
Author

dewomser commented May 3, 2022

Wird auf Github in einem eigenen repository weiterentwickelt:
https://github.com/dewomser/Tweet_and_toot_music_is_playing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment