Skip to content

Instantly share code, notes, and snippets.

@kimihito
Created November 12, 2012 15:33
Show Gist options
  • Select an option

  • Save kimihito/4059999 to your computer and use it in GitHub Desktop.

Select an option

Save kimihito/4059999 to your computer and use it in GitHub Desktop.
Over an hours my tweet post, Twitter update "Zz(つωˇ)" and Profile image change
#!/usr/bin/env ruby
#-*- coding: utf-8 -*-
require 'twitter'
Twitter.configure do |config|
config.consumer_key = 'YOUR_COMSUMER_KEY'
config.consumer_secret = 'YOUR_COMSUMER_SECRET'
config.oauth_token = 'OAUTH_TOKEN'
config.oauth_token_secret = 'OAUTH_TOKEN_SERCRET'
end
created_at = Twitter.user_timeline("kimihito_").first.created_at
now = Time.now
time = now - created_at
HOURS = 60 * 60
icon = open("./icon1.jpg")
iei = open("./iei.jpg")
if time > HOURS
length = time / HOURS
Twitter.update_profile_image(iei)
Twitter.update("Z" + ("z" * length) + " (つωˇ)")
sleep 1
Twitter.update_profile_image(icon)
puts "Tweeted"
end
length = time / HOURS
Twitter.update("Z" + ("z" * length) + " (つωˇ)")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment