ran tsc locally

This commit is contained in:
Kfir Dayan 2024-02-04 12:56:26 +02:00
parent d5408c359b
commit ea7e224c9e
2 changed files with 49 additions and 43 deletions

6
dist/GameSource.js vendored
View file

@ -12,6 +12,8 @@ const moment_1 = __importDefault(require("moment")); // require
class GameSource { class GameSource {
async getGamesFromHaifa() { async getGamesFromHaifa() {
const sourceUrl = `http://mhaifafc.com/games?lang=en`; const sourceUrl = `http://mhaifafc.com/games?lang=en`;
console.log('Trying to get games from Haifa...');
try {
const result = await axios_1.default.get(sourceUrl); const result = await axios_1.default.get(sourceUrl);
const parsedResult = (0, node_html_parser_1.parse)(result.data.toString()); const parsedResult = (0, node_html_parser_1.parse)(result.data.toString());
const gameBoxs = parsedResult.querySelectorAll(".game-box"); const gameBoxs = parsedResult.querySelectorAll(".game-box");
@ -56,6 +58,10 @@ class GameSource {
// return []; // return [];
return games; return games;
} }
catch (error) {
console.error(error);
}
}
findTime(headerSplit) { findTime(headerSplit) {
let time = ''; let time = '';
headerSplit.forEach((item) => { headerSplit.forEach((item) => {

View file

@ -9,7 +9,7 @@ import moment from "moment"; // require
export default class GameSource { export default class GameSource {
async getGamesFromHaifa(): Promise<GoogleCalendarEvent[]> { async getGamesFromHaifa(): Promise<GoogleCalendarEvent[]> {
const sourceUrl = `https://mhaifafc.com/games?lang=en`; const sourceUrl = `http://mhaifafc.com/games?lang=en`;
console.log('Trying to get games from Haifa...'); console.log('Trying to get games from Haifa...');
try { try {
const result = await axios.get(sourceUrl); const result = await axios.get(sourceUrl);