Last active
May 22, 2023 22:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
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
Text steht in der letzten Zeile .
Das Bild muss test.png heißen .
Twurl muss bei Twitter Authorisiert sein mit Key und Token
user muss vom Nutzer angepasstt werden