haifa-reminder/src/GameSource.ts
2023-03-21 19:17:36 +02:00

17 lines
443 B
TypeScript

require('dotenv').config();
import axios from "axios";
// This calss will be the game source.
// search for upcomming games
export default class GameSource {
constructor() {
}
async getGames() {
const sourceUrl = `https://serpapi.com/search.json?q=maccabi+haifa+next+games&api_key=${process.env.SERPAPI_KEY}&location=austin,+texas,+united+states`;
const result = await axios.get(sourceUrl)
return result.data;
}
}