Project

spinacz

0.0
No commit activity in last 3 years
No release in over 3 years
Spinacz.pl API wrapper
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 0.9
~> 1.8
~> 4.0
 Project Readme

Spinacz Rails

This is a Rails Gem for Spinacz API.

Instalation

gem install spinacz

or add it to your Gemfile:

gem 'spinacz'

Usage

Create instance of gem:

spinacz = Spinacz::Client.new(email: 'your@email.here', password: 'P4ssw0rd_H3r3')

or

spinacz = Spinacz::Client.new(token: 'authorization_token_from_login')

or, if you want to use only public methods without authorization:

spinacz = Spinacz::Client.new

You can also use test mode API by adding attribute test to initializer:

spinacz = Spinacz::Client.new(email: 'your@email.here', password: 'P4ssw0rd_H3r3', test: true)

After that, you can access Spinacz methods, for example:

spinacz.login
# login method will set token to spinacz API automatically, to prevent multiple authorizations
spinacz.get_packages_templates 
# this will return whole response from API

Available methods (attributes as stated in Spinacz API documentation):

    spinacz.login
    spinacz.add_package_DHL({...})
    spinacz.add_package_DPD({...})
    spinacz.add_package_FEDEX({...})
    spinacz.add_package_GLS({...})
    spinacz.add_package_INPOST({...})
    spinacz.add_package_KEX({...})
    spinacz.add_package_POCZTA({...})
    spinacz.add_package_UPS({...})
    spinacz.cancel({...})
    spinacz.get_packages_templates
    spinacz.get_paczkomaty({...})
    spinacz.get_placowki({...})
    spinacz.get_send_points
    spinacz.pickup({...})

Contribution

If you want to contribute to the code, just create pull request, and I will merge it ASAP. Thank you for help.

TODO

Add tests. Add better interface for response. Add validations.

License

Copyright (c) 2015 Marcin Adamczyk, released under the MIT license

Feel free to contact me if you need help: marcin.adamczyk [--a-t--] subcom.me