flagflag  If you want to see English page, please click "English" Button at Left.
1: 2010-12-21 (火) 18:14:07 s09081 ソース 現: 2010-12-21 (火) 18:50:11 s09081 ソース
Line 11: Line 11:
フォロー返し~ フォロー返し~
-#!/usr/local/bin/ruby -Ku + #!/usr/local/bin/ruby -Ku 
-require "rubygems" + require "rubygems" 
-require "twitter" + require "twitter" 
-require "logger" + require "logger" 
-file = File.open('follow_kaeshi.log', "a+") + file = File.open('follow_kaeshi.log', "a+") 
-logger = Logger.new(file, 'daily') + logger = Logger.new(file, 'daily') 
-#twitter_id = "#your_twitter_id#" +  APP_TOKEN = ['XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'​] 
-#twitter_pw = "#your_twitter_password#" +  user_atoken = [ 
-  APP_TOKEN = ['XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'​] +  '228631234-XXXXXXXXXXXXXXXXXXXXXXXXXXXXX​XXXXXXXXXXXXXXXXXXXX', 
-  user_atoken = [ +  'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' 
-  '228631234-XXXXXXXXXXXXXXXXXXXXXXXXXXXXX​XXXXXXXXXXXXXXXXXXXX', + 
-  'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + begin 
-  ] +  oauth = Twitter::OAuth.new(*APP_TOKEN) 
-begin +  oauth.authorize_from_access(*user_atoken​) 
-  oauth = Twitter::OAuth.new(*APP_TOKEN) +  twit = Twitter::Base.new(oauth) 
-  oauth.authorize_from_access(*user_atoken​) +  followers = twit.follower_ids 
-  twit = Twitter::Base.new(oauth) +  friends = twit.friend_ids 
-  followers = twit.follower_ids +  new_followers = followers - friends 
-  friends = twit.friend_ids +  new_followers.each do |id| 
-  new_followers = followers - friends +    twit.friendship_create(id) 
-  new_followers.each do |id| +    sleep 1 
-    twit.friendship_create(id) +  end 
-    sleep 1 +  twit.update "フォローしてた人かえしちゃいましたぁ^^!" if new_followers.length != 0 
-  end + rescue Exception => error 
-  twit.update "フォローしてた人かえしちゃいましたぁ^^!" if new_followers.length != 0 +  logger.fatal error 
-rescue Exception => error + end 
-  logger.fatal error +~
-end +
時刻表示~ 時刻表示~
 +~
 + #!/usr/local/bin/ruby -Ku
 +   require 'pp'
 +   require 'twitter'
 + t = Time.now
 + array_days = ["日", "月", "火", "水", "木", "金", "土"]
 + day_jp = array_days[t.wday]
 + puts t.strftime("今は %Y年%m月%d日(#{day_jp}) %H時%M分%S秒です")
 +   APP_TOKEN = ['トークン類ね', '類ね']
 +   user_atoken = [
 +   '228123448-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx​xxxxxxxxxxxx',
 +   'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx​xxxxx'
 +   ]
 +   oauth = Twitter::OAuth.new(*APP_TOKEN)
 +   oauth.authorize_from_access(*user_atoken​)
 +   tw = Twitter::Base.new(oauth)
 +   #自分のタイムラインの取得
 +   pp tw.home_timeline
 +   #自分宛てのReplyの取得
 +   pp tw.mentions
 +   #自分宛てのDMの取得
 +   pp tw.direct_messages
 +   #発言する
 +   pp tw.update(t.strftime("%Y年%m月%d日(#{day_jp}) %H時%M分%S秒をお知らせするですぅ~~"))
 +
 +***Chasen [#c0f78b3d]
 +chasenを使います。辞書はNaistです。~
 +EUCなので辞書はUTF-8に変換します。
 +
 + #!/bin/sh
 + for file in $*
 + do
 + if [ -f $file ]; then
 +     nkf --utf8 $file > tmpfile
 +     mv tmpfile $file
 + fi
 + done
 + exit
-#!/usr/local/bin/ruby -Ku + ./conv_utf-8.sh *.dic *.cha 
-  require 'pp' + `chasen-config --mkchadic`/makemat -i w 
-  require 'twitter' + `chasen-config --mkchadic`/makeda -i w chadic *.dic 
-t = Time.now + make install 
-array_days = ["日", "月", "火", "水", "木", "金", "土"] + echo "この空っぽの胃袋に 何か食料を詰め込まなければ!" | chasen -i w
-day_jp = array_days[t.wday] +
-puts t.strftime("今は %Y年%m月%d日(#{day_jp}) %H時%M分%S秒です") +
-  APP_TOKEN = ['トークン類ね', '類ね'] +
-  user_atoken = [ +
-  '228123448-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx​x', +
-  'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx​xxxxx' +
-  ] +
-  oauth = Twitter::OAuth.new(*APP_TOKEN) +
-  oauth.authorize_from_access(*user_atoken) +
-  tw = Twitter::Base.new(oauth) +
-  #自分のタイムラインの取得 +
-  pp tw.home_timeline +
-  #自分宛てのReplyの取得 +
-  pp tw.mentions +
-  #自分宛てのDMの取得 +
-  pp tw.direct_messages +
-  #発言する +
-  pp tw.update(t.strftime("%Y年%m月%d日(#{day_jp}) %H時%M分%S秒をお知らせするですぅ~~"))+


トップ   新規 ページ一覧 単語検索 最終更新   ヘルプ   最終更新のRSS 1.0 最終更新のRSS 2.0 最終更新のRSS Atom

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 5月翌月
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
<今日>

オンライン状況

87 人のユーザが現在オンラインです。 (15 人のユーザが xpwiki を参照しています。)

登録ユーザ: 0
ゲスト: 87

もっと...

アクセスカウンタ

今日 : 6396639663966396
昨日 : 1753317533175331753317533
総計 : 2346953923469539234695392346953923469539234695392346953923469539
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com