skroutz.ex
A minimalistic Skroutz API client, for Elixir
Installation
To install the package:
-
Add skroutz to your list of dependencies in
mix.exs:
def deps do
[{:skroutz, "~> version_here"}]
end- Ensure skroutz is started before your application:
def application do
[applications: [:skroutz]]
endDocumentation
Resources
Usage
Create a client process
# With OAuth2.0 credentials
{:ok, skroutz} = Skroutz.new(%{client_id: "id", client_secret: "secret"})
# With OAuth2.0 credentials, for the Alve flavor
{:ok, alve} = Skroutz.new(%{client_id: "id",
client_secret: "secret",
flavor: :alve})# With existing Oauth2.0 access token
{:ok, skroutz} = Skroutz.new("a valid access token")Search
{:ok, skroutz} = Skroutz.new("a valid token")
skroutz |> Skroutz.Search.search("nexus 6")Examples
Reminder: You can use Module.module_info(:exports) to get a list of functions available on a module. Then you can use
hinsideiexto print documentation.
h Skroutz.Category.find
# Prints documentation for the functionCategories
{:ok, skroutz} = Skroutz.new("a valid token")
# Get a specific category
skroutz |> Skroutz.Category.find(40)Compatibility
The project has been tested to work with elixir version 1.2.
It may inadvertently work (or seem to work) with other versions, however compatibility and support are not guaranteed.
Development
Running the tests
mix testConsole
iex -S mixOAuth2.0 Credentials
In order for the client to make requests against our API, a valid set of OAuth2.0 credentials provided by us has to be used.
To get yours send an email at api@skroutz.gr.
LICENSE
Copyright (c) 2016 Dimitris Zorbas, MIT Licence. See LICENSE.txt for further details.