Created
August 22, 2017 13:43
-
-
Save shakemurasan/e48800752e4e4cc71d5c6b9bc1738910 to your computer and use it in GitHub Desktop.
clockworkで毎分、指定のURLにアクセスするスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------- 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