From a562e314c0cf8464c100ac7a1c7360efc8fd5bc9 Mon Sep 17 00:00:00 2001 From: Giacomo Vigarelli <62800266+giaco8020@users.noreply.github.com> Date: Sun, 1 Oct 2023 15:52:51 +0200 Subject: [PATCH] Update README.md --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index fc7f909..59c0659 100644 --- a/README.md +++ b/README.md @@ -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()) +} +```