Created
March 20, 2019 06:18
-
-
Save dewomser/3873d1ba96a37d277efba7978d86636f to your computer and use it in GitHub Desktop.
Twitter+ Twurl Tweet mit Bild
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
// Beispiel Twurl Tweet mit Bild | |
// initialisieren mit genauer Byte größe | |
twurl -H upload.twitter.com "/1.1/media/upload.json" -d "command=INIT&media_type=image/jpg&total_bytes=2204" | jq | |
//Das mittlere ist das richtige | |
{ | |
"media_id": 1108021296946917400, | |
"media_id_string": "1108021296946917377", | |
"expires_after_secs": 86399 | |
} | |
//hochladen | |
twurl -H upload.twitter.com "/1.1/media/upload.json" -d "command=APPEND&media_id=1108021296946917377&segment_index=0" --file test.png --file-field "media" | jq | |
//finalisieren | |
twurl -H upload.twitter.com "/1.1/media/upload.json" -d "command=FINALIZE&media_id=1108021296946917377" | jq | |
//text hinzufügen | |
twurl "/1.1/statuses/update.json" -d "media_ids=1108021296946917377&status=Sample Tweet with media_ids and twurl" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Twurl
Upload image and tweet.
media_id_string is generated by twitter, and must be changed at every init