Sistema de Rastreamento de Objetos dos Correios (SRO).
Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 53 commits behind prodis:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.rspec
CHANGELOG.rdoc
Gemfile
Gemfile.lock
README.rdoc
Rakefile
correios-sro-xml.gemspec

README.rdoc

correios-sro-xml

Sistema de Rastreamento de Objetos dos Correios (SRO) utilizando o Web Service SRO XML, que permite a consulta de ate 50 encomendas simultaneamente.

Atenção: esta gem já está funcional, mas ainda não é uma versão estável.

Instalando

Gemfile

gem 'correios-sro-xml'

Instalação direta

$ gem install correios-sro-xml

Usando

require 'correios-sro-xml'

sro = Correios::SRO::Rastreador.new :usuario => "ECT", :senha => "SRO"

Rastreamento de um objeto:

objeto = sro.consultar("SI047624825BR")
objeto.numero                  # => "SI047624825BR"
objeto.eventos.first.data      # => "26/12/2011"
objeto.eventos.first.hora      # => "15:22"
objeto.eventos.first.local     # => "AC CENTRAL DE SAO PAULO"
objeto.eventos.first.descricao # => "Entregue"

Rastreamento de vários objetos:

objetos = sro.consultar("SI047624825BR", "SX104110463BR")

objetos["SI047624825BR"].numero                  # => "SI047624825BR"
objetos["SI047624825BR"].eventos.first.data      # => "26/12/2011"
objetos["SI047624825BR"].eventos.first.hora      # => "15:22"
objetos["SI047624825BR"].eventos.first.local     # => "AC CENTRAL DE SAO PAULO"
objetos["SI047624825BR"].eventos.first.descricao # => "Entregue"

objetos["SX104110463BR"].numero                  # => "SX104110463BR"
objetos["SX104110463BR"].eventos.first.data      # => "08/12/2011"
objetos["SX104110463BR"].eventos.first.hora      # => "09:30"
objetos["SX104110463BR"].eventos.first.local     # => "CEE JUNDIAI"
objetos["SX104110463BR"].eventos.first.descricao # => "Entregue"

Autor

Colaboradores

Contributing to correios-sro-xml

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.

  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

(The MIT License)

Prodis a.k.a. Fernando Hamasaki

Copyright © 2012 Prodis

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.