Last active
January 3, 2016 05:09
-
-
Save rinx/8413976 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cronで適当な間隔でまわして実況する感じ