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
#include <stdio.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <termios.h> | |
#include <unistd.h> | |
int main( void ) | |
{ |
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 -*- | |
# erobbq tweet / earthquake plugin | |
# | |
require 'httpclient' | |
Earthquake.init do | |
command :erobbq do | |
url = "http://shindanmaker.com/168737" | |
html = HTTPClient.new.post(url, { :u => rand(Time.now.to_f), :from => ""} ) | |
r = nil |
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 -*- | |
# takagi RT | |
# | |
# e.g. :takagi $xx | |
# | |
Earthquake.init do | |
command %r|^:takagi\s+(\d+)$|, :as => :takagi do |m| | |
st = cache.read("status:" + m[1]) | |
input("だったら黙ってろクソが RT @%s %s" % [st["user"]["screen_name"], st["text"]]) | |
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 -*- | |
# emoji tweet / earthquake plugin | |
# | |
# dictionary of reference : http://idita.blog11.fc2.com/blog-entry-835.html | |
# | |
# e.g. :emoji ねむい # => update [Zzz]' [Yn] | |
# | |
Earthquake.init do | |
emoji_dict = [["とうろくすおうひょう", [174]], |
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 -*- | |
# usage: | |
# e.g. :erokimos 眠い # => update 'たわわに眠い' [Yn] | |
# | |
Earthquake.init do | |
command %r|^:erokimos\s*(\d+)*\s*(.*)$|, :as => :erokimos do |m| | |
cmd = m[1] ? ":reply #{m[1]}" : ":update" | |
input("%s %s" % [cmd, open(URI.encode("http://erokimos.jgate.de/convert?q=#{m[2]}")){|f| f.read}]) 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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
# | |
# Tumblr photos backup | |
# | |
# | |
require 'rubygems' | |
require 'json' | |
require 'open-uri' | |
require 'fileutils' |
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 -*- | |
# favstar / earthquakge.gem plugin | |
# | |
# e.g. :favstar #=> your favstar | |
# :favstar who #=> who's favstar | |
# | |
require 'open-uri' | |
require 'nokogiri' | |
Earthquake.init 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
# -*- coding: utf-8 -*- | |
# | |
# find kaomoji and replace it with dead | |
Earthquake.init do | |
output_filter do |item| | |
next if item.nil? || item["text"].nil? | |
regexp = /[^\(\342\272\200-\351\276\245ぁ-ヶ…‥!!??]*[\(]+[^\(\)\342\272\200-\351\276\245]+[\);]+[^\(\342\272\200-\351\276\245ぁ-ヶ]*/ | |
dest = ["","爆","即","溺","殴"].shuffle[0] + "死" |
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 'googleajax' | |
GoogleAjax.referer = 'http://foobar.com/' | |
query = ARGV.shift | |
res = GoogleAjax::Search.images(query) |
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 -*- | |
# shoujou filter | |
# | |
require 'natto' | |
Earthquake.init do | |
output_filter do |item| | |
next if item.nil? || item["text"].nil? | |
nm = Natto::MeCab.new |