Skip to content

deathalt/cyprus_events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Event Scraper and Notifier

A simple Go application that scrapes event details from "www.soldoutticketbox.com" every hour and inserts unique events into an SQLite database. If a new unique event is inserted into the database, a notification is sent via a Telegram bot.

Table of Contents

Setup

Prerequisites

  1. Go: Ensure you have Go installed on your machine. If not, follow the official Go installation guide.
  2. SQLite: This application uses SQLite to store event details. Ensure SQLite is installed on your machine.
  3. Telegram Bot: You'll need a Telegram bot token to send notifications and the chat ID of the destination.

Installation

  1. Clone the repository:

    git clone https://github.com/deathalt/cyprus_events
    cd cyprus_events
  2. Install required Go packages:

    go get github.com/PuerkitoBio/goquery
    go get github.com/mattn/go-sqlite3
  3. Set environment variables:

    • TG_BOT_TOKEN: Your Telegram Bot Token.
    • TG_CHAT_ID: The Chat ID where notifications will be sent.
    • SQLITE_PATH: Path to *.db file
    export TG_BOT_TOKEN='your-telegram-bot-token'
    export TG_CHAT_ID='your-chat-id'
    export SQLITE_PATH='/tmp/data.db'

Usage

Simply run the Go application:

go run main.go

The application will scrape event details every hour and notify you on Telegram for any new unique events.

Architecture

  • SQLite: An embedded database used to store and deduplicate event details.
  • goquery: A package that enables HTTP requests and HTML parsing in a jQuery-like syntax.
  • Telegram Bot API: Used to send notifications for newly added events.

Contributing

We welcome any contributions! If you find any issues or would like to add enhancements, please open an issue or a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published