An automated script to fetch and analyze upcoming CS2 matches from HLTV. The script uses the HLTV API to gather data, performs analysis, and saves the results to Azure Blob Storage. 🦉
The frontend for this project is a Chrome extension that reads the match data from the JSON file generated by the backend. It is hosted in a separate repository: HLTV-Chrome-Extension.
To use this script, follow these steps:
- Clone the Repository:
git clone https://github.com/netistul/HLTV-Match-Fetcher.git
- Install Dependencies:
npm install
- Transpile TypeScript to JavaScript:
tsc
- Run the Script:
node lib/hltvMatchFetcher.js
This will execute hltvMatchFetcher.ts
after it's been transpiled to JavaScript. The script fetches upcoming CS:GO matches from HLTV, retrieves and caches team logos, calculates the time until each match, and saves the compiled data as a JSON file. It then uploads this JSON file to Azure Blob Storage for further usage.
Before running the script, you'll need to set up your Azure Blob Storage credentials. Here's how:
-
Create a
.env
file at the root directory of your project. -
Inside the
.env
file, set the following variables:AZURE_ACCOUNT_NAME=your_azure_account_name AZURE_ACCOUNT_KEY=your_azure_account_key
Replace
your_azure_account_name
andyour_azure_account_key
with your actual Azure Blob Storage account name and key.