Skip to content

Instantly share code, notes, and snippets.

@suchi
Last active June 28, 2022 04:55
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 suchi/0e334ba97d6a902fcb608492bef62f70 to your computer and use it in GitHub Desktop.
Save suchi/0e334ba97d6a902fcb608492bef62f70 to your computer and use it in GitHub Desktop.
calling URI.open via Kernel#open is deprecated, call URI.open directly
# coding: utf-8
# martin bakerから助かった人の数を取得する
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'date'
html = Nokogiri::HTML(URI.open('https://www.martin-baker.com/'))
count = html.search('h1>span')[0].text.to_i
date = Date.today.strftime("%Y/%m/%d")
puts "#{date}\t#{count}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment