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 | |
# coding : utf-8 | |
require 'stringio' | |
require 'mail' | |
class ThinWire | |
attr_accessor :last_hash,:target_dir,:report |
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 | |
# coding:utf-8 | |
require 'open-uri' | |
require 'json' | |
require 'base64' | |
str = ARGV.shift | |
uri = "http://rospeex.ucri.jgn-x.jp/nauth_json/jsServices/VoiceTraSS?method=speak¶ms[]=ja¶ms[]=#{URI.encode(str)}¶ms[]=*¶ms[]=audio/x-wav&_=1386261073492" | |
obj = JSON.parse(open(uri).read) |
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
# ページの外部リソースをbase64で埋め込みする | |
class Mechanize::Page | |
def embed_body | |
self.embed_style | |
self.embed_script | |
self.embed_images |
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 | |
#coding:utf-8 | |
require "rubygems" | |
require 'evernote' | |
#先程取得したToken | |
auth_token = "S=s23:U=270295:E=xxxxxxxxxxxx:C=xxxxxxxxx:P=1cd:A=en-devtoken:V=2:H=xxxxxxxxxxx816XXXXXXXXXXXX" | |
#ノートのエンドポイントのURL | |
note_store_url = "https://www.evernote.com/shard/s23/notestore" | |
# 正しくは以下のような形式じゃないとダメらしいけど、決め打ちでOKだった。 |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export3.dtd"> | |
<en-export export-date="20140215T165250Z" application="Evernote" version="Evernote Mac 5.5.0 (402474)"> | |
<note><title>TODOテンプレート</title><content><![CDATA[<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"> | |
<en-note> | |
<div><font face="'Hiragino Maru Gothic Pro'" color="#000C76" size="4">■①これは何? </font><font size="2">できたらどうなるの?</font> | |
</div> | |
<div> | |
<hr/> |
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 'optparse' | |
require 'open3' | |
text , image,url,video = nil | |
opt = OptionParser.new | |
opt.on("-i [image]", "--image", "Set Image to tweet ") { |e| image = e } | |
opt.on("-u [url]", "--url", "Set URL to tweet ") { |e| url = e } | |
opt.on("-v [video]", "--video", "Set video to tweet ") { |e| video = e } |
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 | |
#coding:utf-8 | |
require 'pp' | |
require 'optparse' | |
opt = OptionParser.new | |
link=nil | |
begin | |
opt.on("-e", "--link","brew の gnuコマンドを/usr/local/bin にリンクします"){ link=true; } |
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
u = location.href; | |
t = "takuya-hateblo-22"; | |
a = (function(url, tag) { | |
asin = (function(url) { | |
if (r = url.match(/gp\/product\/([^\/]+)/)) { | |
return r[1]; | |
} else if (r = url.match(/dp\/([^\/]+)/)) { | |
return r[1]; | |
} else { | |
return; |
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
(function(long_url,callback){ | |
bi = new URL("https://api-ssl.bitly.com/v3/shorten?"); | |
var params = [ | |
"login=YOUR_USER_ID", | |
"domain=j.mp", | |
"apiKey=YOUR_API_KEY", | |
"longUrl="+ encodeURIComponent(long_url) | |
] | |
bi.search = "?"+params.join('&') | |
var xhr = new XMLHttpRequest(); |
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 | |
# coding: utf-8 | |
require 'mechanize' | |
require 'kconv' | |
def regist( mail ) | |
Thread.new{ | |
m = Mechanize.new |