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
# -*- coding: utf-8 -*- | |
# beer tweet / earthquake plugin | |
# | |
# e.g. :beer うまい #=> ビうまいール | |
# | |
Earthquake.init do | |
command :beer do |m| | |
input(":update ビ#{m[1]}ール") | |
end | |
end |
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
# -*- coding: utf-8 -*- | |
# byun tweet / earthquake plugin | |
# | |
# e.g. :byun hoge # => update '=͟͟͞͞h=͟͟͞͞o=͟͟͞͞g=͟͟͞͞e' [Yn] | |
# | |
Earthquake.init do | |
command %r|^:byun\s*(\d+)*\s+(.+)$|, :as => :byun do |m| | |
cmd = m[1] ? ":reply #{m[1]}" : ":update" | |
input("%s %s" % [cmd, m[2].each_char.inject(""){|s,c| s << "=͟͟͞͞#{c}"}]) |
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
# -*- coding: utf-8 -*- | |
# | |
Earthquake.init do | |
once do | |
SHORT_URL_REGEXP = %r|https?://\w+\.\w+/\w+[^\W]| | |
end | |
output_filter do |item| | |
next if item.nil? || item["text"].nil? || (urls = item["text"].scan(SHORT_URL_REGEXP)).empty? |
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
# -*- coding: utf-8 -*- | |
Earthquake.init do | |
output_filter do |item| | |
next if item.nil? || item["text"].nil? | |
!(/^.+[¥"QR]T(?:[:\s]*@[A-Za-z0-9_]|\(via[:\s]*@[A-Za-z0-9_]).+[¥"QR]T/ =~ item["text"]) | |
end | |
end | |
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
# -*- coding: utf-8 -*- | |
# | |
# e.g. | |
# [$ab] foo: yo! | |
# . | |
# . | |
# [$nz] who: yo! | |
# | |
# ⚡ :echo | |
# update 'yo!' [Yn] |
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
# -*- coding: utf-8 -*- | |
# | |
Earthquake.init do | |
output_filter do |item| | |
("aa".."zz").to_a.each{|v| | |
break unless id = var2id("$#{v}"); | |
next unless st = cache.read("status:#{id}"); | |
if st["text"] \ |
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
# -*- coding: utf-8 -*- | |
# (reply|favorite|retweet|delete|thread|repalce) to recent tweet of specified user in cache. | |
# you can specifiy '-n' index. | |
# | |
module Earthquake::Input | |
def recent_status_id(name,index = -1) | |
a = ("aa".."zz").to_a.inject([]){|s,v| | |
break s unless id = var2id("$#{v}"); | |
next s unless st = cache.read("status:#{id}"); |
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
# -- coding: utf-8 | |
require "fileutils" | |
require "digest/md5" | |
Earthquake.init do | |
dir = File.join(File.dirname(__FILE__), "userimage") | |
output do |item| | |
next if item.nil? || item["user"].nil? | |
begin |
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
# -*- coding: utf-8 -*- | |
# | |
# ~/.earthquake/config | |
# | |
# Earthquake.config[:raw_text] = true | |
# | |
Earthquake.init do | |
output_filter do |item| |
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
# -*- coding: utf-8 -*- | |
# おじいちゃん plugin | |
# | |
Earthquake.init do | |
t = lambda{(rand(2) == 0 ? Time.now.to_f : nil).to_s} | |
command /^:ガバリ|:gabari/, :as => :gabari do | |
input("ガバリ " + t.call) | |
end |