Skip to content

Instantly share code, notes, and snippets.

View tdtds's full-sized avatar
🐱
🐱

Tada, Tadashi tdtds

🐱
🐱
View GitHub Profile
@tdtds
tdtds / mixi2gmail.diff
Created March 22, 2009 13:03
yoosee作mixi2gmailのバグfix差分
--- mixi2gmail.rb.20080404 2008-04-08 11:17:42.000000000 +0900
+++ mixi2gmail.rb 2009-03-22 14:11:33.000000000 +0900
@@ -34,7 +34,14 @@
rescue LoadError
end
require 'nkf'
+
require 'mechanize'
+require 'hpricot'
+begin
@tdtds
tdtds / tsite.rb
Created February 7, 2010 05:37
getting current T-Point by scraping tsite.jp.
#! /usr/bin/env ruby
#
# tsite.rb: getting current T-Point by scraping tsite.jp.
#
# Copyright (C) 2011 by TADA Tadashi <t@tdtds.jp>
# Distributed under GPL.
#
require 'rubygems'
require 'mechanize'
#!/home/sho/bin/ruby19
class Template
def initialize( &block )
@child = []
instance_eval( &block )
end
def result
@child.join( "\n" )
#!/bin/sh
#
# Copyright (c) 2010 Shinnosuke Suzuki <sasasin@sasasin.net>
# You can distribute this file under the GPL.
#
# Modified by TADA Tadashi <t@tdtds.jp>
#
FILE=$1
if [ -z $FILE ]; then
echo usage: pdf2kindle PDFfile [top bottom left right]
@tdtds
tdtds / OBSOLETE
Created December 8, 2010 22:16
getting MM9's text from webmysteries.jp.
#
# This command was obsolete. see also https://github.com/tdtds/aozoragen
#
#!/usr/bin/env ruby
#
# getting text from webmysteries.jp's novel.
#
require 'open-uri'
require 'nokogiri'
This project was moved to https://github.com/tdtds/kindlizer
@tdtds
tdtds / maouyusya2aozora.rb
Created December 21, 2010 09:29
まとめサイト上の「まおゆう」を青空文庫形式のテキストファイルに変換する
#!/usr/bin/ruby
# -*- coding: utf-8; -*-
#
require 'open-uri'
require 'nokogiri'
puts "魔王「この我のものとなれ、勇者よ」勇者「断る!」"
puts "橙乃ままれ"
puts "\n\n"
@tdtds
tdtds / nikkei-scraper.rb
Created January 4, 2011 08:51
日経電子版をスクレイピングして、Kindle向けOPFを作る
#!/usr/bin/env ruby
# -*- coding: utf-8; -*-
#
# scraping nikkei.com for Kindle
#
require 'nokogiri'
require 'open-uri'
TOP = 'http://www.nikkei.com'
@tdtds
tdtds / internet-watch-scraper.rb
Created January 26, 2011 21:55
Internet Watchのfeedから、Kindle向けOPFを作る
#!/usr/bin/env ruby
# -*- coding: utf-8; -*-
#
# scraping internet.watch.impress.co.jp for Kindle
#
require 'nokogiri'
require 'open-uri'
require 'uri'
require 'ostruct'
@tdtds
tdtds / OBSOLETE
Created October 23, 2011 04:47
無償公開されているFate/Zero1を青空文庫形式に変換する
#
# This command was obsolete. see also https://github.com/tdtds/aozoragen
#
#!/usr/bin/env ruby
# -*- coding: utf-8; -*-
#
# Usage: making PDF for Kindle using Aozira-Kindle Servive.
# % ruby fate-zero1_to_aozora > fate1.txt
# % curl --data-urlencode text@fate1.txt -d s=m -o fate1.pdf http://a2k.aill.org/download.cgi