This file contains 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
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
def getSearch(search_uri) | |
html = Hpricot(open(search_uri)) | |
html.search("a").each { |a| | |
if a.inner_text != "" && a.attributes['href'] =~ /comeplay\.php/ |
This file contains 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 'sendgmail.rb' | |
require 'yaml' | |
@log_dir = "/path/to/log" | |
@channels = %w{#xxxxx@freenode #xxxxx@twitter} | |
@file_name = Time.now.strftime("%Y.%m.%d.txt") | |
@keywords = "key1|key2|key3" | |
@send_mail_address = "[email protected]" |
This file contains 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/local/bin/ruby | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
require 'uri' | |
require 'kconv' | |
def getWord(page) | |
html = Hpricot(open(URI.parse(@uri) + page)) |
This file contains 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 | |
$LOAD_PATH << 'lib' | |
$LOAD_PATH << '../lib' | |
require 'optparse' | |
require 'rubygems' | |
require 'net/irc' | |
require 'uri' | |
require 'mechanize' |
This file contains 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
require 'nokogiri' | |
require 'open-uri' | |
class TwitterSearch < Citrus::Plugin | |
def on_privmsg(prefix, channel, message) | |
if message =~ /(#{@config["words"]})/ && | |
(!@config["channels"] || @config["channels"].include?(channel)) | |
words = $1 if message =~ /^tws\s(.+)$/ | |
search(words.split(/\s/)).each { |result| |
This file contains 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
require 'open-uri' | |
require 'hpricot' | |
class Twitter < Citrus::Plugin | |
def on_privmsg(prefix, channel, message) | |
if /#{@config["prefix"]}/ =~ message | |
user = $2 | |
html = Hpricot(open("http://twitter.com/#{user}")) |
This file contains 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 'flickr' | |
require 'fileutils' | |
api_key = "" | |
secret = "" | |
flickr = Flickr.new('flickr.dat',api_key, secret) |
This file contains 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
class Hoge | |
def fuga | |
loop do | |
for i in 1..10 | |
puts "fuga: #{Time.now.instance_eval { '%s.%03d' % [strftime('%Y%m%d%H%M%S'), (usec / 1000.0).round] }}" | |
end | |
sleep 5 | |
end | |
rescue | |
puts "Hoge::fuga Dead" |
This file contains 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
for /l %i in (0,1,255) do ping -w 1 -n 1 192.168.0.%i && arp -a 192.168.0.%i >> arp.log |
This file contains 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 'nokogiri' | |
require 'uri' | |
require 'open-uri' | |
require 'timeout' | |
def getScreenName(address) | |
p address |
OlderNewer