Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ca1d5ef
Showing
5 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
カオスラウンジでの展示物です。 | ||
|
||
* 復旧方法 | ||
* マシンに液晶プロジェクターを認識させるために再起動 | ||
* ログインは ssig33:kogaidan | ||
* pkill xscreen でスクリーンセーバーを停止する | ||
* ターミナルで ssh ssig33.com して hametsu コマンドで起動 | ||
* F11 でフルスクリーンにして Ctrl と + や Ctrl と - を使って文字サイズを調節 | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env ruby | ||
# -*- coding: utf-8 -*- | ||
$KCODE = "u" | ||
require 'thread' | ||
require 'net/http' | ||
require 'uri' | ||
require 'rubygems' | ||
require 'json' | ||
require 'wedata' | ||
require 'stream' | ||
require 'word' | ||
require 'pit' | ||
|
||
config = Pit.get("hametsu_twitteR", :require => { | ||
"username" => "your email in Twitter", | ||
"password" => "your password in Twitter", | ||
}) | ||
|
||
@ingos = get_ingo_list | ||
|
||
USERNAME = config["username"] | ||
PASSWORD = config["password"] | ||
l = Queue.new | ||
s = Queue.new | ||
|
||
th1 = Thread.start do | ||
while r = l.pop | ||
print_str_color r["text"] | ||
sleep 0.5 | ||
end | ||
end | ||
|
||
p1 = Thread.start do | ||
sample s | ||
end | ||
|
||
p2 = Thread.start do | ||
detect_sample_japanese s, l | ||
end | ||
|
||
p3 = Thread.start do | ||
search l | ||
end | ||
|
||
th1.join |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# -*- coding: utf-8 -*- | ||
require 'rubygems' | ||
require 'json' | ||
require 'open-uri' | ||
require 'cgi' | ||
require 'memcache' | ||
|
||
def cache | ||
MemCache.new "localhost:11978" | ||
end | ||
|
||
def sample q | ||
begin | ||
while true | ||
uri = URI.parse 'http://stream.twitter.com/1/statuses/sample.json' | ||
|
||
Net::HTTP.start(uri.host, uri.port) do |http| | ||
request = Net::HTTP::Get.new(uri.request_uri) | ||
# Streaming APIはBasic認証のみ | ||
request.basic_auth(USERNAME, PASSWORD) | ||
http.request(request) do |response| | ||
response.read_body do |chunk| | ||
# 空行は無視する = JSON形式でのパースに失敗したら次へ | ||
status = JSON.parse(chunk) rescue next | ||
# 削除通知など、'text'パラメータを含まないものは無視して次へ | ||
next unless status['text'] | ||
user = status['user'] | ||
q.push status | ||
end | ||
end | ||
end | ||
|
||
end | ||
rescue => e | ||
retry | ||
end | ||
end | ||
|
||
def detect_sample_japanese s, l | ||
while r = s.pop | ||
t = r["text"] | ||
if (/おっぱい/ =~t or /幼女/ =~t or /フェラ/ =~ t or /セックス/ =~t or /マンコ/ =~ t or /チンポ/ =~ t or /ペニス/ =~t or /レイプ/ =~t or /おまんこ/ =~t or /淫乱/ =~t or /オナニー/ =~t or /勃起/ =~t or /貧乳/ =~t or /ちんこ/ =~t or /ロリコン/ =~t or /巨乳/ =~t or /輪姦/ =~t or /強姦/ =~t or /オッパイ/ =~t or /おちんぽ/ =~t or /クンニ/ =~t or /きんたま/ =~t or /キンタマ/ =~t or /アナル/ =~t or /縞パン/ =~ t) | ||
l.push r | ||
cache["tweet_#{r["id"]}"] = r | ||
end | ||
end | ||
end | ||
|
||
def search l | ||
while true | ||
url = "http://search.twitter.com/search.json?q=#{CGI.escape("おっぱい OR 幼女 OR フェラ OR セックス OR マンコ OR チンポ OR ペニス OR レイプ OR おまんこ OR 淫乱")}&result_type=recent&rpp=100" | ||
result = JSON.parse(open(url).read) | ||
result["results"].each do |r| | ||
if cache["tweet_#{r["id"]}"] == nil | ||
l.push r | ||
cache["tweet_#{r["id"]}"] = r | ||
end | ||
end | ||
url = "http://search.twitter.com/search.json?q=#{CGI.escape("オナニー OR 勃起 OR 貧乳 OR ちんこ OR ロリコン OR 巨乳 OR 輪姦")}&result_type=recent&rpp=100" | ||
result = JSON.parse(open(url).read) | ||
result["results"].each do |r| | ||
if cache["tweet_#{r["id"]}"] == nil | ||
l.push r | ||
cache["tweet_#{r["id"]}"] = r | ||
end | ||
end | ||
url = "http://search.twitter.com/search.json?q=#{CGI.escape("強姦 OR オッパイ OR おちんぽ OR クンニ OR きんたま OR キンタマ OR アナル OR 縞パン")}&result_type=recent&rpp=100" | ||
result = JSON.parse(open(url).read) | ||
result["results"].each do |r| | ||
if cache["tweet_#{r["id"]}"] == nil | ||
l.push r | ||
cache["tweet_#{r["id"]}"] = r | ||
end | ||
end | ||
|
||
sleep 60 | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# -*- coding: utf-8 -*- | ||
require 'rubygems' | ||
require 'json' | ||
require 'open-uri' | ||
require 'cgi' | ||
require 'memcache' | ||
|
||
def get_ingo_list | ||
array = [] | ||
we = JSON.parse(open("http://wedata.net/databases/%E6%B7%AB%E8%AA%9E/items.json").read) | ||
we.each do |w| | ||
array << w["data"]["japanese"] | ||
end | ||
return array | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env ruby | ||
# -*- coding: utf-8 -*- | ||
require 'rubygems' | ||
require 'term/ansicolor' | ||
include Term::ANSIColor | ||
|
||
def print_str_color str | ||
@ingos.each do |w| | ||
if /#{w}/ =~ str | ||
@a = process_str str, w | ||
break | ||
end | ||
end | ||
a = @a | ||
a.each_with_index do |i,k| | ||
print i | ||
if k%2 == 1 | ||
print reset | ||
end | ||
if k%2 == 0 | ||
print red | ||
end | ||
end | ||
print reset,"\n" | ||
end | ||
|
||
def process_str str,word | ||
a = Array.new | ||
str.split(word).each_with_index do |s,i| | ||
a << s | ||
if (i%2 == 0 or i >= 1) and i != (str.split(word).size - 1) | ||
a << word | ||
end | ||
end | ||
return a | ||
end | ||
|
||
#print_str_color "ぜひとも!おっぱい! RT @ibiru: インターネット&サブカル系編集者です。先生、またカラオケにて RT @otonaryoku お、! ど、どうして呼んでくださらなかったんですか! RT @nonakaaan: おっぱい大きいJJとの飲み楽しかったなう" |