CarRegistrationCzechRepublic 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/CarRegistrationCzechRepublic.rb +20 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f10d80b20eedddff634326a726871687969dbb54
|
4
|
+
data.tar.gz: 21a3102c1c35ee383244d76fe5c3dacd01b0195b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ee1d2a1d95a534ffd9dc2d5260035d56a136a53f2d5dff51588dfed68e553da8aa518c32aee2a8484dcce86f2063fc62d6a6ad4355dacadddc5a964bfd57858d
|
7
|
+
data.tar.gz: 9dba8c5d14af899b2f5d347d55f530e7c8899ed5e3248d95773fa33942f6c4c62c28825870833f273972de2f7b14940a6a7c1d8cd6def949319d65087003af0d
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "open-uri"
|
2
|
+
require "json"
|
3
|
+
|
4
|
+
class CarRegistrationLookupError < StandardError
|
5
|
+
def initialize(msg="Unknown error")
|
6
|
+
super
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class CarRegistrationCzechRepublic
|
11
|
+
def self.Lookup(registrationNumber,username,password)
|
12
|
+
begin
|
13
|
+
@data = open("https://www.regcheck.org.uk/api/json.aspx/CheckCzechRepublic/" + registrationNumber,http_basic_authentication: [username, password]).read
|
14
|
+
rescue OpenURI::HTTPError => error
|
15
|
+
raise CarRegistrationLookupError, error.io.string
|
16
|
+
end
|
17
|
+
return JSON.parse(@data)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: CarRegistrationCzechRepublic
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Infinite Loop
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-08-14 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Find Car details from a number plate in the Czech Republic. An Account
|
14
|
+
is required from http://www.vehicleregistrationapi.com/
|
15
|
+
email: info@infiniteloop.ie
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/CarRegistrationCzechRepublic.rb
|
21
|
+
homepage: http://www.vehicleregistrationapi.com
|
22
|
+
licenses:
|
23
|
+
- MIT
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.6.11
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: Find Car details from a number plate in the Czech Republic.
|
45
|
+
test_files: []
|