#twitter-video-tweet
#####(via Ruby!)
##One-liner description:
Tweet a video to Twitter with the power of Ruby!!
##About this project:
Disclaimer: This project assumes you know and have read documentation on the Twitter API, and how to get user access_tokens: https://dev.twitter.com/rest/public
This is an explanatory project. I highly recommend you read carefully, as Twitter made their API complicatedly stupid. ( for good reasons of course. ) I Commented and left code loose and less optimized to more easily understand the process. I also wanted to make it easy for anyone to integrate what they've learned here into their own projects.
The project can upload a 30 second video under 15mb as per Twitter rules. But you will need to hack it a little to actually get a twitter video to upload. This isn't a solution as much as it is a vehicle of information to better describe and relate what is needed to get something uploaded. Theoretically it "just works" ;)
# you should have already created an Twitter App, visit https://apps.twitter.com/
TWITTER_CONSUMER_ID = "your_app_key"
TWITTER_CONSUMER_SECRET = "your_app_secret"
# you should have already gotten these tokens already when oauthorizing the user.
twitter_user = OpenStruct.new({:access_token => "token", :access_secret => "secret"})
video_uploader = Twitter::Tweet::Video.new(twitter_user, "A video Tweet!", "./video.mp4")
video_uploader.tweet!
Use the HTTPLog gem or something similar to debug anything, it helps!!
Cheers and good luck!
~Godzilogg
######This project is licensed under a three-clause BSD style license.