Skip to content

Instantly share code, notes, and snippets.

@rinx
Last active January 3, 2016 05:09
Show Gist options
  • Save rinx/8413976 to your computer and use it in GitHub Desktop.
Save rinx/8413976 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
#-*- coding: utf-8 -*-
require 'twitter'
# --- define consts ---
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
ACCESS_SECRET = ''
# --- main ---
imgname = "fswebcam_img"
system("fswebcam -d /dev/video0 -S 5 #{imgname}.jpg")
client = Twitter::REST::Client.new do |config|
config.consumer_key = CONSUMER_KEY
config.consumer_secret = CONSUMER_SECRET
config.access_token = ACCESS_TOKEN
config.access_token_secret = ACCESS_SECRET
end
client.update_with_media(Time.now.to_s, File.open("#{imgname}.jpg"))
system("rm -rf #{imgname}.jpg")
@rinx
Copy link
Author

rinx commented Jan 19, 2014

cronで適当な間隔でまわして実況する感じ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment