darwiin / tickets-resto-nc

Implémentation Java de l'API de http://www.ticketrestaurant.nc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Join the chat at https://gitter.im/tickets-resto-nc-api/Lobby Dependency Status

tickets-resto-nc-api

Implémentation Java de l'API du site Web des tickets restaurants de Nouvelle-Calédonie (http://www.ticketrestaurant.nc).

Actuellement il n'existe pas d'API pour interagir avec ce sîte Web : cela est maintenant possible.

Projets connexes

Une appli jhypster : https://github.com/DSI-Ville-Noumea/ticket-restonc-web est en cours de développement qui tente de couvrir les fonctionnalités non couvertes aujourd'hui sur le site officiel :

  • envoie des notifications dès qu'une transaction est effectuée
  • site web qui ajoute un visu et des fonctionnalités qui correspondent davantage à nos attentes (statistiques, reporting, ...)

Autres idées

Implémenter une appli android qui permet de consulter son solde entre autres.

Use case

Pour recuperer les datas, tout simplement :

            String login = "xxxxxxxxx";
            String password = "xxxxxx";
            
            TicketsRestaurantsServiceWrapper wrap = new TicketsRestaurantsServiceWrapper(login, password);
            // now deal with with account, credit, transactions ;-p
            System.out.println("################################################");
            System.out.println("Solde (XPF) : " + wrap.getAccountBalance());
            System.out.println("Employeur : " + wrap.getAccountEmployeer());
            System.out.println("Beneficiaire : " + wrap.getAccountName());
            // Listing transactions
            System.out.println("Transactions :\n");
            Iterator<Transaction> iter = wrap.getTransactions().iterator();
            
            while (iter.hasNext()) {
                System.out.println(iter.next().toString());
                
            }
            System.out.println("################################################");

Output :

################################################
Solde (XPF) : 21310
Employeur : MAIRIE DE NOUMEA
Beneficiaire : MR ADRIEN SALES
Transactions :

Date : Mon Apr 24 00:00:00 SBT 2017 (Recharge)
Date : Fri Apr 14 00:00:00 SBT 2017 (Transaction CHAMPION N'GEA)
Date : Tue Apr 04 00:00:00 SBT 2017 (Transaction CHAMPION N'GEA)
Date : Fri Mar 31 00:00:00 SBT 2017 (Recharge)
Date : Wed Mar 29 00:00:00 SBT 2017 (Recharge)
################################################


Récupération des affiliés

ArrayList<Affilie> affilies = TicketsRestaurantsServiceWrapper.getAffilies();
Iterator<Affilie> affIter = affilies.iterator();
Affilie aff = new Affilie();
            
logger.info("Affilies :\n");
while(affIter.hasNext()){
    aff =  affIter.next();
    logger.info(aff.toString());
}

Use this lib in your project

Follow jitpack instructions, see https://jitpack.io/#adriens/tickets-resto-nc-api

Motivations

  • Deal with htmlunit
  • Deal with Apache POI
  • Discover advanced features of Google Spreadsheets : dashboatd, reporting, mobile apps based on spreadsheets, ...
  • Getting fun as we gain the power on the data

About

Implémentation Java de l'API de http://www.ticketrestaurant.nc

License:GNU Lesser General Public License v3.0


Languages

Language:Java 100.0%