Created
November 12, 2012 15:33
-
-
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
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' | |
| 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