is_down 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d29affe8c1224b78dbc0c3f78a3730840b72ccae
4
- data.tar.gz: 4ceb8bffdd35b89a57a1b91b4a7d912b5c4af0c3
3
+ metadata.gz: 49f80b6d77ab334ca9e2cec357b2099b05849485
4
+ data.tar.gz: 3370b7b2f22c12aab63cfd6c035a72ded5bf3447
5
5
  SHA512:
6
- metadata.gz: 5b5380be275b048f9d4ee2ab7296a789ebe818f5eee186b26cca0335dfd6748b0d16004668556d9ec4167669fd00068a3409de318c7f85b5f7a3628c5be9e213
7
- data.tar.gz: f0f219d217ab030fcd4daf68ba2210d1bb8f165e9e9326ac2596bbe38096b00a87649dd79b26e48a7c9e6422fa64726b6335f8502d9d7fdd4513978809593b6f
6
+ metadata.gz: d6c8f557726afd2d5e4cff79f8cd6c678a0bae6045e61d4fa0970f0a872cd8519031ec24be54362d21caec330d21d71e18822bdc869b06587b22e05627b5436d
7
+ data.tar.gz: b82d4d46feed9b77fc3d0c1874713b3149cf3f7951ac6bb47eed52651636a529d6e8db9b965149e4e1deca86291e8bdf36d45897fa30b7026b01298db4d67403
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # IsDown
2
2
 
3
- Check if a website is up and running or not.
3
+ Check if a website is up and running or not using isitup.org API.
4
4
 
5
5
  ## Installation
6
6
 
@@ -33,6 +33,12 @@ require 'is_down'
33
33
  puts IsDown.is_down?("www.facebook.com") # false
34
34
  puts IsDown.is_up?("www.facebook.com") # true
35
35
  ```
36
+
37
+ ## Common issues
38
+ On Windows, Ruby may raise an SSL error ("certificate verify failed"). To fix it:
39
+ 1. Download a cacert from https://curl.haxx.se/docs/caextract.html
40
+ 2. Set an environment variable 'SSL\_CERT\_FILE' to the path of the downloaded file.
41
+
36
42
  ## Development
37
43
 
38
44
  1. Fork this repo
data/is_down.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = IsDown::VERSION
9
9
  spec.authors = ["Gr3atWh173"]
10
10
  spec.email = ["Gr3atWh173@users.noreply.github.com"]
11
- spec.summary = %q{rubygem to check if a website is down or not.}
11
+ spec.summary = %q{rubygem to check if a website is down or not using isitup.org API.}
12
12
  spec.homepage = "https://www.github.com/Gr3atWh173/is_down"
13
13
  spec.license = "MIT"
14
14
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
data/lib/is_down.rb CHANGED
@@ -1,9 +1,10 @@
1
1
  require "is_down/version"
2
2
  require "net/http"
3
+ require "json"
3
4
 
4
- # check if a website is up or not using downforeveryoneorjustme.com
5
+ # check if a website is up or not using isitup.org API
5
6
  module IsDown
6
- ISUPME = "http://downforeveryoneorjustme.com"
7
+ ISITUP = "https://isitup.org/"
7
8
 
8
9
  # check if a website is down
9
10
  # takes a domain name as the only argument
@@ -15,6 +16,7 @@ module IsDown
15
16
  # checks if a website is up
16
17
  # takes a domain name as the only argument
17
18
  def self.is_up?(host)
18
- Net::HTTP.get_response(URI(ISUPME + "/" + host)).body.include?("is up")
19
+ resp = Net::HTTP.get_response(URI(ISITUP + host + ".json"))
20
+ JSON.parse(resp.body)['status_code'] == 1
19
21
  end
20
22
  end
@@ -1,3 +1,3 @@
1
1
  module IsDown
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: is_down
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gr3atWh173
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-10 00:00:00.000000000 Z
11
+ date: 2018-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -65,5 +65,5 @@ rubyforge_project:
65
65
  rubygems_version: 2.5.2
66
66
  signing_key:
67
67
  specification_version: 4
68
- summary: rubygem to check if a website is down or not.
68
+ summary: rubygem to check if a website is down or not using isitup.org API.
69
69
  test_files: []