Skip to content

Instantly share code, notes, and snippets.

View ainame's full-sized avatar

Satoshi Namai ainame

View GitHub Profile
@ainame
ainame / twitter_searcher.rb
Created December 27, 2011 21:34
インタプリタ上でTwitterのgemが使いやすくするためのラッパー
require 'twitter'
require 'json'
module MyTwitter
def self.activate
@config = JSON.parse(open("settings.json").read)
Twitter.configure do |config|
config.consumer_key = @config["consumer_key"]
config.consumer_secret = @config["consumer_secret"]
config.oauth_token = @config["oauth_token"]
# -*- coding: utf-8 -*-
# $KCODE = "SJIS"
module Kif
Piece = {
"FU" => "歩", "KE" => "桂", "KY" =>"香",
"GI" => "銀", "KI" => "金", "KA" => "角",
"HI" => "飛", "OU" => "玉", "TO" => "と",
"NG" => "成銀", "NK" => "成桂", "NY" => "成香",
"UM" => "馬", "RY" => "竜"
# ---- Kifu for Windows V6.24 棋譜ファイル ----
開始日時:
手合割:平手
先手:normal
後手:N_100
手数----指手---------消費時間--
1 7六歩(77) ( 00:01/00:00:01)
2 8四歩(83) ( 00:01/00:00:01)
3 6八銀(79) ( 00:01/00:00:02)
4 3四歩(33) ( 00:01/00:00:02)
# -*- coding: utf-8 -*-
#
# ぼくのかんがえた最強のWeb API利用のためのモジュール
# モジュール名適当
# かなーりゆるい設計
#
module AnythingResource
class Procedure < Proc
# 手続きを記述するための
require 'active_support/time'
unless ARGV[0]
puts 'usage: ruby twilog.rb SCREEN_NAME YEAR'
exit(1)
end
screen_name = ARGV[0]
year = ARGV[1] || Date.today.year
2011-01-08:二郎初め、府中二郎、小豚全マシ http://movapic.com/pic/201101081939374d283ee91ec23
2011-01-15:小金井二郎、小豚全マシ! http://movapic.com/pic/201101152007564d31800cabd8b
2011-01-25:仙川二郎、小豚全マシ http://movapic.com/pic/201101251812124d3e93ec1a8a0
2011-01-29:中山二郎、大豚全マシ! http://yfrog.com/gyktvwsj
2011-02-03:西日が差す、大豚W全マシ @ ラーメン二郎 三田本店 http://instagr.am/p/BXLrY/
2011-02-14:仙川二郎小豚全マシ http://instagr.am/p/BmSrO/
2011-02-19:着いた。麺切れ回避できた。 (@ ラーメン二郎 八王子野猿街道店2 w/ 2 others) [pic]: http://4sq.com/i9seXg https://www.facebook.com/photo.php?fbid=303865692985806&set=a.261499573889085.62854.100000871336323&type=1&theater
2011-03-03:仙川二郎、小豚全マシ! @ ラーメン二郎 仙川店 http://instagr.am/p/B91l_/
2011-03-10:品川二郎、小豚W全マシヤサイタワー @ ラーメン二郎 品川店 http://instagr.am/p/CITwC/
2011-03-14:仙川二郎、豚入りラーメン全マシ! @ ラーメン二郎 仙川店 http://instagr.am/p/CO-Sm/
2011-01-08:二郎初め、府中二郎、小豚全マシ http://movapic.com/pic/201101081939374d283ee91ec23
2011-01-15:小金井二郎、小豚全マシ! http://movapic.com/pic/201101152007564d31800cabd8b
2011-01-25:仙川二郎、小豚全マシ http://movapic.com/pic/201101251812124d3e93ec1a8a0
2011-01-29:中山二郎、大豚全マシ! http://yfrog.com/gyktvwsj
2011-02-03:西日が差す、大豚W全マシ @ ラーメン二郎 三田本店 http://instagr.am/p/BXLrY/
2011-02-14:仙川二郎小豚全マシ http://instagr.am/p/BmSrO/
2011-02-19:着いた。麺切れ回避できた。 (@ ラーメン二郎 八王子野猿街道店2 w/ 2 others) [pic]: http://4sq.com/i9seXg https://www.facebook.com/photo.php?fbid=303865692985806&set=a.261499573889085.62854.100000871336323&type=1&theater (追加)
2011-03-03:仙川二郎、小豚全マシ! @ ラーメン二郎 仙川店 http://instagr.am/p/B91l_/
2011-03-10:品川二郎、小豚W全マシヤサイタワー @ ラーメン二郎 品川店 http://instagr.am/p/CITwC/
2011-03-14:仙川二郎、豚入りラーメン全マシ! @ ラーメン二郎 仙川店 http://instagr.am/p/CO-Sm/
# -*- coding: utf-8 -*-
require 'active_support/time'
require 'json'
require 'scanf'
require 'net/http'
require 'nkf'
require_relative './csv.rb'
require 'pp'
# "147908914338480128","111217 142007","府中二郎の小ラーメン全部(豚・温泉玉子・チーズ)入りの食券 http://t.co/RMh2BDwP"
# -*- coding: utf-8 -*-
#
# 自分のbot
require 'active_support'
require 'twitter'
require 'json'
# モジュール名未定
module Chofu
module Twitter
# -*- coding: utf-8 -*-
# RubyBestPracticeに載っている書き方
# 以下の解説ページを参照
# http://www.mapee.jp/ruby/post_66.html
class BlockRun
def initialize
@handlers = { }
end