選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

32 行
679 B

# Kitten Info
# Required Modules
require "http/client"
# Network Status
client = HTTP::Client.new("google.com")
# Set Timeouts to 1.5 seconds
client.connect_timeout = 1.5
client.dns_timeout = 1.5
begin
response = client.get("/")
network = "Connected"
rescue Socket::Error
# Disconnect due to DNS error and usually no network access
network = "Disconnected"
rescue IO::Timeout
# Network Timeout
network = "Timeout"
rescue errno
# Disconnect due unreachable host
network = "Disconnected"
end
# Architecture Command
arch = `uname -m`
# Print Information
puts "Internet: " + network
puts "Hostname: " + System.hostname
puts "Archtecture: " + arch