Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- STATMSG="What happens when we apply the ripple effect to land instead of water? #gamedev"
- FILENAME="Segment_0001.mp4"
- FILESIZE=$(stat -f%z "$FILENAME")
- split -b 5m $FILENAME
- RESULT=$(twurl -H upload.twitter.com "/1.1/media/upload.json" -d "command=INIT&media_type=video/mp4&total_bytes=$FILESIZE")
- RESULTID=$(echo "$RESULT" | grep -Po '(?<="media_id_string":")[^"]*')
- echo "$STATMSG $FILENAME $FILESIZE $RESULT $RESULTID"
- twurl -H upload.twitter.com "/1.1/media/upload.json" -d "command=APPEND&media_id=$RESULTID&segment_index=0" --file ./xaa --file-field "media"
- if [ "$FILESIZE" -gt "5242880" ];
- then twurl -H upload.twitter.com "/1.1/media/upload.json" -d "command=APPEND&media_id=$RESULTID&segment_index=1" --file ./xab --file-field "media";
- fi
- if [ "$FILESIZE" -gt "10485760" ];
- then twurl -H upload.twitter.com "/1.1/media/upload.json" -d "command=APPEND&media_id=$RESULTID&segment_index=2" --file ./xac --file-field "media";
- fi
- twurl -H upload.twitter.com "/1.1/media/upload.json" -d "command=FINALIZE&media_id=$RESULTID"
- twurl "/1.1/statuses/update.json" -d "status=$STATMSG&media_ids=$RESULTID"
Advertisement
Add Comment
Please, Sign In to add comment