Skip to content

Instantly share code, notes, and snippets.

@Yamabiko
Created December 23, 2013 12:54
Show Gist options
  • Save Yamabiko/8096671 to your computer and use it in GitHub Desktop.
Save Yamabiko/8096671 to your computer and use it in GitHub Desktop.
プロフィールをいじるプログラム
require 'twitter'
TW_CONSUMER_KEY = " your consumer key "
TW_CONSUMER_SECRET = " your consumer secret "
TW_ACCESS_TOKEN = " your access token "
TW_ACCESS_TOKEN_SECRET = " your access token secret "
# ログイン
# ログイン不要な操作もありますがこれやっとけば大抵問題ない(適当
twClient = Twitter::REST::Client.new do |config|
config.consumer_key = TW_CONSUMER_KEY
config.consumer_secret = TW_CONSUMER_SECRET
config.access_token = TW_ACCESS_TOKEN
config.access_token_secret = TW_ACCESS_TOKEN_SECRET
end
twClient.update_profile({:name => "new_name", :url => "url", :location => "location", :description => "description"})
# 引数のハッシュには、更新したい要素だけ記述すればOK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment