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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b48fbccdbc66a90c82fd1c4193b48348c303dc88
4
- data.tar.gz: cbff8c567013e5362253557fa9d60097969c7cc8
3
+ metadata.gz: b52aa6ff3963bfb2e0a4058af3f9075897e7ad18
4
+ data.tar.gz: 66850c91f2df81317d42f84515186324ce8a7e90
5
5
  SHA512:
6
- metadata.gz: b00416a4843df87acc82ccfd5e3f16c184f70d5f6215f9fc259f1ff81c4b91d3297322fe335287343188be68bedbfb93dfdfdbf6fabd29176eb81125527e3266
7
- data.tar.gz: e0bebbaa35eca2c94f3ed8c4e29ed269e1006af3e244b1f89e59b6ec8a9a4191cceaebf29662452b68cf5d4a726bb708cb56fc3acf258f4b2d79ec8397909e8f
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`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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 = "3ktTqS63LBPlOT3WgFlk"
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>iPhone</b>
28
- <c>iPhone OS</c>
29
- <j></j>
27
+ <b>motorola XT1078</b>
28
+ <c>ANDROID</c>
30
29
  <i>#{lat}</i>
31
- <m>1204fdd387279490261aaf95a6567f64</m>
32
- <e>SinespCidadao</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>9.1</d>
34
+ <d>6.0</d>
36
35
  <h>#{long}</h>
37
- <k>#{SecureRandom.uuid}</k>
36
+ <k />
38
37
  <l>#{Time.now}</l>
39
38
  </soap:Header>
40
39
  <soap:Body>
@@ -1,3 +1,3 @@
1
1
  module SinespClient
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-02 00:00:00.000000000 Z
11
+ date: 2016-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler