Created
May 6, 2022 07:17
-
-
Save dewomser/16d1b47101ffda371cb22f8ab059e5f9 to your computer and use it in GitHub Desktop.
Screenshot Twittern mit Kommentar
This file contains hidden or 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
!/bin/bash | |
cd $HOME/bin | |
import tweet.png | |
wait | |
# byte="$(du -b tweet.png | cut -b -5)" | |
byte="$(du -b tweet.png | tr -d -c 0-9)" | |
user="twitter_user" | |
## // 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 tweet.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 | |
# a=$(kdialog --textinputbox "Dialog-Tweeter" "$1") | |
a=$(kdialog --textinputbox "Dialog-Tweeter") | |
if [[ $? = 0 ]]; then | |
twurl -u $user "/1.1/statuses/update.json" -d "media_ids=$mis&status=Ein Bashscript mit payload: $a" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Import funktioniert nicht mit Wayland !