#!/usr/local/bin/ruby #hatena_counter.rb require 'open-uri' require "pp" require 'uri' #url = 'http://mukar.com/test.cgi?cont=日本語テスト ホゲホゲ' #url_escape = URI.escape(url) #puts url_escape #=> http://mukar.com/test.cgi?cont=%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%83%86%E3%82%B9%E3%83%88%20%E3%83%9B%E3%82%B2%E3%83%9B%E3%82%B2 #puts URI.unescape(url_escape) #=>http://mukar.com/test.cgi?cont=日本語テスト ホゲホゲ # # ↑こいつ最高にアホ! はわわわ アイコンをアバターとしたチャット。ともだちられシステムは.. text = <<"EOS" はてなの名でやるような事でもない

2006-09-24

はてなの名でやるような事でもない

自分のサーバーでやれよって感じだなぁ、と言っているとラボが終わってしまうので気分の良い時はてきとうなものを作ることにする。jkondoのkondoは公私混同のkondoやで。

これくらいのものを2日に1つとかのペースで出していったら話題になるだろうか。12週連続リリースみたいな。

記事への反応(ブックマークコメント)

ようこそ ゲスト さん
EOS =begin target_date = [] urls = ["https://anond.hatelabo.jp/archive/200609"] urls.each do |url| OpenURI.open_uri(url).each_line do |html| new_line_has_been_html = html.gsub(/
  • /, "\n
  • ") new_line_has_been_html.each_line do |line| if line =~ %r|
  • .+| target_date << line.slice(%r|
  • .+|, 1) end end end end =end =begin urls = ["https://anond.hatelabo.jp/archive/200609"] archive_page_htmls = [] urls.each do |url| OpenURI.open_uri(url).each_line do |html| archive_page_htmls << html end end =end =begin target_date = [] target_title = [] #エントリーの日付を取得 text.each_line do |html| html.gsub(/
  • /, "\n
  • ").each_line do |line| target_date << line.slice(%r|href="(/2\d+)">(.+).+/, "\n
  • ").each_line do |line| target_title << line.slice(%r|href="(/2\d+)">(.+) .+ (.+) |, 2) if line =~ %r|href="/2\d+">.+ | #エントリーが2種類に別れる。仕様の詳細は不明 end end =end target_date = [] target_title = [] #記事への反応を取得 text.each_line do |html| html.gsub(//, "\n
  • ").each_line do |line| # target_date << line.slice(%r|href="(/2\d+)">(.+).+/, "\n
  • ").each_line do |line| date = line.slice(%r|href="(/2\d+)">(.+).+(.+) .+ (.+) |, 2) if line =~ %r|href="/2\d+">.+ | #エントリーが2種類に別れる。仕様の詳細は不明 target_date_and_title << [date, title] end end =end #target_pairs.each do |d| # puts URI.unescape(d) #end #エントリーの日付とタイトルを合成 #target_date_and_title = [target_date, target_title].transpose #array.each_slice(2).to_a #target_date_and_title.each do |d| # puts d unless d[0] == nil #end #pp target_date_and_title