Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
giaco8020 authored Oct 1, 2023
1 parent 8a25a5f commit a562e31
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,29 @@ Itabus.search_tickets("Milan", "Bologna", "2023-10-10")
.catch(err => console.log(`Error searching: ${err.message}`));

```

# How To Use - Station retrieval
```js
const ItabusAPI = require("itabus-api")
const Itabus = new ItabusAPI()

const result = Itabus.get_station("Milano")

if(result.success === false){
console.log(result.error)
} else {
console.log(result.data)

//Id of Station
console.log(result.data.getCode())

//City of Station
console.log(result.data.getCity())

//Address of Station
console.log(result.data.getAddress())

//List of available destinations from this station
console.log(result.data.getDestinations())
}
```

0 comments on commit a562e31

Please sign in to comment.