A Node.js application that monitors (cronjob) Cineplex BD for specific movie availability and sends notifications via ntfy to your mobile app (ntfy) when tickets become available.
- Monitors specific movies based on configurable criteria (title, actors, director, movie ID, category)
- Sends instant notifications when target movies are found
- Provides detailed show times and seat availability (%) information
- Supports image attachments in notifications
- Node.js (v14 or higher)
- ntfy server for notifications
- Cron job scheduler (optional, for automated monitoring)
-
Clone or download the project files
-
Install dependencies:
npm install
-
Create a
.envfile in the project root:cp .env.example .env
-
Configure the environment variables in
.env(copy from request header):CINEPLEX_TOKEN=your_cineplex_api_token_here
-
Install ntfy server:
# Ubuntu/Debian sudo apt install ntfy -
Start ntfy server:
ntfy serve
-
Update the notification server details in
index.js:const ntfyReq = http.request({ hostname: 'localhost', // Change to your server IP port: 80, // Change to your server port path: `/${ntfyTopic}`, method: 'POST', headers: headers });
-
Update the notification function in
index.js:const ntfyReq = https.request({ hostname: 'ntfy.sh', port: 443, path: `/${ntfyTopic}`, method: 'POST', headers: headers });
-
Subscribe to notifications:
# Mobile app or web browser # Visit: https://ntfy.sh/movie-alert # CLI subscription ntfy subscribe movie-alert
Edit the MOVIE_DETECTION_CONSTANTS object in index.js to monitor different movies:
const MOVIE_DETECTION_CONSTANTS = {
TITLES: ['superman'],
ACTORS: ['david corenswet', 'nicholas hoult', 'rachel brosnahan'],
GENRES: ['action', 'adventure', 'sci-fi'],
IMAGE_KEYWORDS: ['superman'],
MOVIE_ID: 1640,
CATEGORY: '3D',
DIRECTOR: ['james gunn']
};node index.js-
Open crontab:
crontab -e
-
Add a cron job to run every 15 minutes:
*/15 * * * * cd /path/to/cineplex-scraper && node index.js >> /path/to/cineplex-scraper/log.txt 2>&1
-
Alternative: Run every hour:
@hourly /path/to/cineplex-scraper && node index.js >> /path/to/cineplex-scraper/log.txt 2>&1
-
Create a service file:
sudo nano /etc/systemd/system/cineplex-monitor.service
-
Add the following content:
[Unit] Description=Cineplex Movie Monitor After=network.target [Service] Type=simple User=your_username WorkingDirectory=/path/to/cineplex-scraper ExecStart=/usr/bin/node index.js Restart=always RestartSec=900 Environment=NODE_ENV=production [Install] WantedBy=multi-user.target
-
Enable and start the service:
sudo systemctl daemon-reload sudo systemctl enable cineplex-monitor.service sudo systemctl start cineplex-monitor.service
The application sends two types of notifications:
- Movie Found Alert: Basic notification when target movie is detected
- Detailed Show Times: Comprehensive information including:
- Available show dates
- Screen details
- Show times with pricing
- Seat availability with color-coded indicators
- The application automatically detects token expiration
- Update the
CINEPLEX_TOKENin your.envfile when notified
- Connection refused errors: Check ntfy server is running and accessible
- No movies found: Verify movie detection criteria in configuration
- API errors: Ensure token is valid and properly formatted
Check the console output or log file for detailed execution information.
- Keep your
.envfile secure and never commit it to version control - The
.gitignorefile is configured to exclude sensitive files - Consider using environment variables in production deployments