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 'open-uri' | |
require 'tmpdir' | |
Earthquake.init do | |
command :aview do |m| | |
if File.exist?(m[1]) or m[1] =~ /^http/ | |
url = m[1] | |
else |
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
Earthquake.init do | |
command :circle do |m| | |
text = m[1].unpack("U*").map {|i| | |
[*case i | |
when 97..122 # a-z | |
i + 0x24d0 - 97 | |
when 65..90 | |
i + 0x24b6 - 65 | |
when 49..57 | |
i + 0x245f - 48 |
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
# earthquake.gem plugin | |
# shorten url using bit.ly if text is over 140 | |
Earthquake.init do | |
config[:bitly] ||= {} | |
config[:bitly][:username] ||= 'earthquakegem' | |
config[:bitly][:api_key] ||= 'R_22e702353baf49751d053660e4c71a30' | |
config[:bitly][:domain] ||= 'j.mp' | |
input_filter do |text| | |
if /^:(update|reply|retweet|message)\s+/ === text and text.size - $&.size > 140 |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'ruby-growl' | |
require 'socket' | |
require 'shellwords' | |
require 'cgi' | |
UDPSocket.open do |u| | |
u.bind('localhost', Growl::GROWL_UDP_PORT) | |
loop do |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' | |
module Jleague | |
module_function | |
def miniscore2mobile | |
uri = "http://www.tbs.co.jp/supers/miniscore#{rand( 3 ) + 1}.htm" |