正しい実装でt.coの見えない世界へ
document: https://dev.twitter.com/docs/streaming-api/user-streams
| #coding:utf-8 | |
| require 'time' | |
| def reset_limit | |
| now = Time.now | |
| year = now.year | |
| years = now.year | |
| month = now.month | |
| #now = Time.parse("2011-08-31 23:08:26") |
| ary=gets.chomp.split('');tweet=[];140.times{tweet<<ary[rand(ary.size)]};p(tweet.join) | |
| #=> ruby glitch_tweet.rb | |
| #=> もう何も恐くない | |
| #=> "何いな何もくうなういう何いくく恐うもなももも何ななもううもももも恐恐何く何くいもくももう何恐なく何いなな何ななもううも恐うくももくもうもうい何何何もくな恐何何もな何いくいいう何なもういもいくうく恐いいくも何くいい何うもももくなうくくもくなもなううないなくももなく恐くう恐いも何くい" |
| // ==UserScript== | |
| // @name A smart dashboard have my id | |
| // @namespace http://mitukiii.jp/ | |
| // @description TumblrのDashboardで自分からReblogされた/自分のidを含んだpostを折り畳むスクリプト | |
| // @include http://www.tumblr.com/dashboard* | |
| // @author mitukiii | |
| // @compatibility Firefox 5.0(Scriptish 0.1), Chrome 12.0.742.112, Opera 11.50 | |
| // @charset UTF-8 | |
| // @version 0.0.2.20110707180600 | |
| // ==/UserScript== |
| module FooHelper | |
| def unclear_time(to_time, from_time = Time.now.change(:hour => 0)) | |
| from_time = from_time.to_time if from_time.respond_to?(:to_time) | |
| to_time = to_time.to_time if to_time.respond_to?(:to_time) | |
| distance_in_minutes = (((to_time - from_time).abs)/60).round | |
| case distance_in_minutes | |
| when 0..4320 then "三日以内" | |
| when 4321..10080 then "一週間以内" | |
| when 10081..44640 then "一か月以内" |
| require 'rubygems' | |
| require 'sinatra' | |
| require 'facebook_oauth' | |
| configure do | |
| set :sessions, true | |
| end | |
| before do | |
| next if request.path_info =~ /ping$/ |
| require 'rubygems' | |
| require 'sinatra' | |
| require 'twitter_oauth' | |
| configure do | |
| set :sessions, true | |
| end | |
| before do | |
| next if request.path_info =~ /ping$/ |
| /^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@((docomo|ezweb|softbank|[dhtcrknsq]{1}\.vodafone|disney|jp-[dhtcrknsq]{1}|sky\.(tkk|tkc|tu-ka)|((di|dj|wm)\.)?pdx|emnet|vertuclub)\.ne\.jp|mopera\.net|dwmail\.jp|i\.softbank\.jp|willcom\.com$/ |
| #!/usr/bin/env ruby | |
| require 'net/http' | |
| EMAIL = 'メールアドレス' | |
| PASS = 'パスワード' | |
| HOME = 'http://kksg.tumblr.com' #アップロードするTumblrのurl | |
正しい実装でt.coの見えない世界へ
document: https://dev.twitter.com/docs/streaming-api/user-streams
| path = ARGV.shift | |
| if File.exists?(path) && path.match(/^(.+)\.(jpe?g|jp2)$/) | |
| filename = $1 | |
| ext = $2 | |
| files = [] | |
| 10.times do |i| | |
| 10.times do |j| | |
| if i != j | |
| files << output = "#{filename}_ikemen_#{i}#{j}.#{ext}" | |
| `cat #{path} | sed s/#{i}/#{j}/g > #{output}` # gsed じゃなくて sed にした |