mirror of
https://github.com/dewomser/Toot_music_is_playing.git
synced 2026-03-13 16:37:17 +01:00
patH
This commit is contained in:
parent
fa8ea75770
commit
db0e6ced1d
1 changed files with 8 additions and 4 deletions
12
tweet_music
12
tweet_music
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#//config. Twitteruser wihout @
|
#//config. Twitteruser wihout @
|
||||||
|
user="dewomser"
|
||||||
|
#if you need full path … find with which ruby ; which twurl
|
||||||
|
#twurlp="/usr/bin/ruby /home/foo/.local/share/gem/ruby/3.0.0/bin/twurl"
|
||||||
|
twurlp="twurl"
|
||||||
user="twitteruser"
|
user="twitteruser"
|
||||||
#//Musikinfo von Clementie Audioplayer holen
|
#//Musikinfo von Clementie Audioplayer holen
|
||||||
readarray a <<< "$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep -E 'artUrl|genre|artist|album:|title:'| sed -e 's/xesam://g'| sed -e 's/mpris:artUrl: file:\/\///g')"
|
readarray a <<< "$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep -E 'artUrl|genre|artist|album:|title:'| sed -e 's/xesam://g'| sed -e 's/mpris:artUrl: file:\/\///g')"
|
||||||
|
|
@ -15,11 +19,11 @@ text="Ich höre gerade:${a[1]}${a[2]}${a[4]}"
|
||||||
#// Bildgröße in Byte ermitteln
|
#// Bildgröße in Byte ermitteln
|
||||||
byte=$(du -b cover.jpg | grep -Eo "^[0-9]+")
|
byte=$(du -b cover.jpg | grep -Eo "^[0-9]+")
|
||||||
#// initialisieren
|
#// initialisieren
|
||||||
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=$($twurlp -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}"
|
mis="${mis:1: -1}"
|
||||||
#//hochladen
|
#//hochladen
|
||||||
twurl -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "command=APPEND&media_id=$mis&segment_index=0" --file cover.jpg --file-field "media" | jq .
|
$twurlp -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "command=APPEND&media_id=$mis&segment_index=0" --file cover.jpg --file-field "media" | jq .
|
||||||
#//finalisieren
|
#//finalisieren
|
||||||
twurl -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "command=FINALIZE&media_id=$mis" | jq .
|
$twurlp -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "command=FINALIZE&media_id=$mis" | jq .
|
||||||
#//text hinzufügen
|
#//text hinzufügen
|
||||||
twurl -u $user "/1.1/statuses/update.json" -d "media_ids=$mis&status=$text"
|
$twurlp -u $user "/1.1/statuses/update.json" -d "media_ids=$mis&status=$text"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue