A simple command line tool to check the current dollar value from a specified website.
This project is a Node.js command line application that fetches the current dollar value from the website Dólar Hoje. It parses the website's HTML to extract the dollar value and prints it to the console.
-
Clone the repository:
git clone https://github.com/yourusername/dollar-cli.git
-
Navigate to the project directory:
cd dollar-cli
-
Install the dependencies:
npm install
To run the application, use the following command:
npm start
This command will fetch the current dollar value from the website and print it to the console in the format:
To get $ 1,00 today we need R$ [value]
index.js
: The main file containing the logic to fetch and parse the dollar value from the website.package.json
: The configuration file for npm, including project metadata and dependencies.
accessWebsite()
: Fetches the HTML content of the website and extracts the dollar value.getDollarValueFromWebsiteContent(websiteContent)
: Parses the HTML content to find the dollar value.printMessage(value)
: Prints the extracted dollar value to the console.
https
: Node.js module to make HTTPS requests.@biomejs/biome
: Development dependency for code quality and formatting.nock
: Development dependency for HTTP server mocking.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m 'Add your feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a pull request.
This project is licensed under the MIT License.
Pablo Trindade