Skip to content

Instantly share code, notes, and snippets.

@ayucat
Created November 17, 2008 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayucat/25883 to your computer and use it in GitHub Desktop.
Save ayucat/25883 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'nkf'
require 'uri'
hatena_id = 'ayucat_on_tabelog'
log_filename = 'nov17.txt'
open('nov17.out', 'w') { |ff| open(log_filename) { |f| f.read.split(/\n/).map { |l| ff.puts('+ [http://d.hatena.ne.jp/' + hatena_id + '/searchdiary?word=' + URI.encode(NKF.nkf('-We', l)) + ':title=' + l + ']') } } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment