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
# -*- encoding: utf-8 -*- | |
require 'nokogiri' | |
require 'open-uri' | |
require 'Sequel' | |
require './SSparser.rb' | |
# for ankake.blog.jp | |
s = SSparser.new |
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
# -*- encoding: utf-8 -*- | |
require 'nokogiri' | |
require "open-uri" | |
require 'sequel' | |
def insert(dbname, urls) | |
db = Sequel.connect("sqlite://#{dbname}") | |
urls.each do |url| | |
db[:url].insert(value: url) |
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
# -*- encoding: utf-8 -*- | |
require 'classifier' | |
require './db_manager.rb' | |
require 'natto' | |
@nm = Natto::MeCab.new | |
def wakati(str) | |
array = [] | |
@nm.parse(str) do |n| |
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
# -*- encoding: utf-8 -*- | |
require './wakati.rb' | |
require './db_manager.rb' | |
class Intelligence | |
def initialize | |
@wakati = Wakati.new | |
db = DbManager.new | |
@responds = db.read("amami.db") |
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
# -*- encoding: utf-8 -*- | |
require 'nokogiri' | |
require "open-uri" | |
require './SSparser.rb' | |
require './db_manager.rb' | |
# http://ssimas.blog.fc2.com/ | |
#url = 'http://ssimas.blog.fc2.com/blog-entry-3218.html#more' |
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
gets | |
member = { | |
'J' => 1, | |
'O' => 2, | |
'I' => 4 | |
} | |
def dumpArray(array) | |
array.each do |value| |
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
RollingBox box3d; | |
float counter; | |
void setup(){ | |
size(500, 800, P3D); | |
box3d = new RollingBox(); | |
counter = 0; | |
frameRate(60); | |
} |
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
# -*- encoding: utf-8 -*- | |
require 'tweetstream' | |
require 'twitter' | |
require 'date' | |
require './key.rb' | |
rest = Twitter::REST::Client.new do |config| | |
config.consumer_key = Const::CONSUMER_KEY | |
config.consumer_secret = Const::CONSUMER_SECRET | |
config.access_token = Const::ACCESS_TOKEN | |
config.access_token_secret = Const::ACCESS_TOKEN_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
# -*- encoding: utf-8 -*- | |
require 'natto' | |
@natto = Natto::MeCab.new | |
def getSS | |
sentenses = [] | |
File.read("./ss.txt", :encoding => Encoding::UTF_8).split("\n").each do |str| | |
sentenses.push str if str.include?("「") and str.include?("」") | |
end | |
sentenses.map! do |sentense| |
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
# -*- encoding: utf-8 -*- | |
require 'natto' | |
require 'twitter' | |
require 'tweetstream' | |
require './key.rb' | |
@rest = Twitter::REST::Client.new do |config| | |
config.consumer_key = Const::CONSUMER_KEY | |
config.consumer_secret = Const::CONSUMER_SECRET | |
config.access_token = Const::ACCESS_TOKEN | |
config.access_token_secret = Const::ACCESS_TOKEN_SECRET |