sinesp_client 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -2
- data/lib/sinesp_client.rb +7 -8
- data/lib/sinesp_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b52aa6ff3963bfb2e0a4058af3f9075897e7ad18
|
4
|
+
data.tar.gz: 66850c91f2df81317d42f84515186324ce8a7e90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1fdeda4f1ddb4a02f299bddc650a83d72e1de127a388b830ffe08171b377444ec04da1f81fae12dea1b304013cc95c66ef7bf539f9d7e4a145d37016411e741
|
7
|
+
data.tar.gz: fd13bf962d41dbe93301cb9d1ac3cb4425fd91ad5da18650216d40180e0fc72ad67375665d91964da735d7a3ca7e68f6683cac0242971fbab67ce614318902bc
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
|
1
2
|
# Ruby Sinesp Client
|
2
3
|
|
3
|
-
This gem provides a client for searching vehicle data based on the license plate from Sinesp database. This data is publicly available at https://www.sinesp.gov.br/sinesp-cidadao. The gem just makes it easier to fetch results, through the same endpoint used by the mobile app.
|
4
|
+
This gem provides a client for searching vehicle data based on the license plate from Sinesp database. This data is publicly available at https://www.sinesp.gov.br/sinesp-cidadao. The gem just makes it easier to fetch results, through the same endpoint used by the mobile app.
|
5
|
+
|
6
|
+
For a python version, please check this: https://github.com/victor-torres/sinesp-client
|
4
7
|
|
5
8
|
## Installation
|
6
9
|
|
@@ -27,11 +30,15 @@ SinespClient.search 'ABC1234'
|
|
27
30
|
|
28
31
|
Returns a hash with basic vehicle data.
|
29
32
|
|
33
|
+
## Limitations
|
34
|
+
|
35
|
+
Sinesp seems to block connections originated from outside of Brazil. TODO: make the gem work with proxy.
|
36
|
+
|
30
37
|
## Development
|
31
38
|
|
32
39
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
33
40
|
|
34
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
41
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
35
42
|
|
36
43
|
## Contributing
|
37
44
|
|
data/lib/sinesp_client.rb
CHANGED
@@ -17,24 +17,23 @@ module SinespClient
|
|
17
17
|
|
18
18
|
def self.search(plate)
|
19
19
|
|
20
|
-
key = "
|
20
|
+
key = "TRwf1iBwvCoSboSscGne"
|
21
21
|
digest = OpenSSL::Digest.new('sha1')
|
22
22
|
hash = OpenSSL::HMAC.hexdigest(digest, plate + key, plate)
|
23
23
|
|
24
24
|
body = "<?xml version='1.0' encoding='utf-8'?>
|
25
25
|
<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
|
26
26
|
<soap:Header>
|
27
|
-
<b>
|
28
|
-
<c>
|
29
|
-
<j></j>
|
27
|
+
<b>motorola XT1078</b>
|
28
|
+
<c>ANDROID</c>
|
30
29
|
<i>#{lat}</i>
|
31
|
-
<m>
|
32
|
-
<e>
|
30
|
+
<m>8797e74f0d6eb7b1ff3dc114d4aa12d3</m>
|
31
|
+
<e>4.1.1</e>
|
33
32
|
<f>10.0.0.1</f>
|
34
33
|
<g>#{hash}</g>
|
35
|
-
<d>
|
34
|
+
<d>6.0</d>
|
36
35
|
<h>#{long}</h>
|
37
|
-
<k
|
36
|
+
<k />
|
38
37
|
<l>#{Time.now}</l>
|
39
38
|
</soap:Header>
|
40
39
|
<soap:Body>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinesp_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabiano Arruda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|