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
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
#!/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
#!/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 | |
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
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/ |
NewerOlder