Skip to content

Instantly share code, notes, and snippets.

@shakemurasan
Created August 22, 2017 13:43
Show Gist options
  • Save shakemurasan/e48800752e4e4cc71d5c6b9bc1738910 to your computer and use it in GitHub Desktop.
Save shakemurasan/e48800752e4e4cc71d5c6b9bc1738910 to your computer and use it in GitHub Desktop.
clockworkで毎分、指定のURLにアクセスするスクリプト
# ---------- getting started ----------
# gem install clockwork
# nohup clockwork clock.rb &
# ---------- stop process ----------
# ps -x | grep clock
# kill [id]
require 'clockwork'
require 'net/http'
include Clockwork
TARGET_URL = "https://www.yahoo.co.jp/"
every(1.minutes, 'scrape') do
Net::HTTP.get_print(URI.parse(TARGET_URL))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment