Skip to content

An nodejs micro GraphQL server for fetching trenitalia.com solutions

Notifications You must be signed in to change notification settings

bwlt/trenitalia-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TRENITALIA SCRAPER

Greenkeeper badge Build Status

A GraphQL interface to trenitalia.com website solutions.


Try it with the GraphiQL interface on https://trenitalia-scraper.now.sh/.
The schema is explorable and documented on GraphiQL using the Docs tab (top right position).

Sample query:

query($origin: Station!, $destination: Station!, $date: Date!, $time: TimeHour!) {
  solutions(origin: $origin, destination: $destination, date: $date, time: $time, limit: 2, offset: 2) {
    idsolution
    origin
    destination
    direction
    departuretime
    arrivaltime
    minprice
    duration
    changesno
    trainlist {
      trainidentifier
      trainacronym
      traintype
      pricetype
    }
    bookable
    saleable
    onlycustom
    showSeat
  }
}

# variables (bottom left panel on GraphiQL)
{
  "origin": "Milano Centrale",
  "destination": "Treviso Centrale",
  "date": "20/07/2017",
  "time": "08"
}

Release notes

  • 2017-07-01, v0.1.0
    Breaking change: Changed Solution GraphQL Object.
    Reduced response time and supporting more query arguments on solutions query.
    Under the hood:
    • Using mobile website API instead of scraping desktop website: more fast and simple
  • 2017-06-24, v0.0.1 Initial draft

About

An nodejs micro GraphQL server for fetching trenitalia.com solutions

Resources

Stars

Watchers

Forks

Packages

No packages published