Subscribe News Feed Subscribe Comments

モザイクアートのためのリフォロープログラム Twitter-Following



※2010年6月からBasic認証が廃止されるので使えなくなりますたぶん
【OAuth認証版】モザイクアートのためのリフォロープログラム Twitter-Following
長く使う場合は↑の方へ



2010年4月25日 例外処理追記

#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'

articon = 'miuchan' #使うアイコンのusername この場合 http://twitter.com/miuchan1
username = 'username' #自分のユーザーネームに変更
password = 'password' #自分のパスワードに変更
twitter = Twitter::Base.new(Twitter::HTTPAuth.new(username, password))

#Remove Section
i = 1
while i < 37
followlist = articon + i .to_s
begin
twitter.friendship_destroy followlist
rescue
puts 'unfollowでなんかのエラー'
puts 'リトライ'
sleep 5
retry
end
i = i + 1
end

#Follow Section
i = 1
while i < 37
followlist = articon + i .to_s
begin
twitter.friendship_create followlist
rescue
puts 'followでなんかのエラー'
puts 'リトライ'
sleep 5
retry
end
i = i + 1
sleep 1
end

下準備

まずRubyをパソコンで使えるようにして、例えばWindowsならRubyGems Package Managerを起動してgem install twitterと入力してEnterキーを押しましょう。
次に、頑張ってアカウントを36個取る。
ちなみにGmailなら
hoge@gmail.com
hoge+icon1@gmail.com
hoge+icon2@gmail.com
    …
のように+の後に付け足せばいくらでもメールアドレスを増殖できます。
アイコン画像は分割結合「あ」などのフリーソフトでサクッと36分割する。

使い方

赤字のusername、password、iconを書き換える
上のプログラムの場合モザイクアート用捨てアカのusernameが
icon1
icon2
icon3
 ・
 ・
 ・
icon36
となってる場合に使えます。

使う方のプログラムをメモ帳にコピペしてnantoka.rbの名前で保存
例えばc:\rubyに保存した場合メモ帳を開いて


cd c:\ruby
ruby nantoka.rb

なんかあったら@dotlinerまで。

0 コメント:

コメントを投稿

 
臼経ビジネスオンライン | TNB