-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun.bat
70 lines (62 loc) · 1.7 KB
/
run.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
@echo off
setlocal enabledelayedexpansion
:: Check if Python is installed
python --version > nul 2>&1
if errorlevel 1 (
echo Python is not installed. Please install Python 3.8 or higher.
pause
exit /b 1
)
:: Create data directory if it doesn't exist
if not exist "data" (
mkdir data
echo Created data directory
)
:: Check if virtual environment exists
if not exist "venv" (
echo Creating virtual environment...
python -m venv venv
if errorlevel 1 (
echo Failed to create virtual environment
pause
exit /b 1
)
)
:: Activate virtual environment and install dependencies
echo Activating virtual environment...
call venv\Scripts\activate.bat
:: Install requirements
echo Installing dependencies...
pip install -r requirements.txt
if errorlevel 1 (
echo Failed to install dependencies
pause
exit /b 1
)
:: Check for .env file
if not exist ".env" (
if exist ".env.example" (
echo Creating .env file from .env.example...
copy .env.example .env
echo Please edit the .env file with your settings:
echo - TARGET_USERNAME: Twitter username to track
echo - SCAN_INTERVAL_MINUTES: Time between scans
echo - SYNC_INTERVAL_MINUTES: Time between API syncs
echo - WEB_PORT: Port for web interface
echo - API_ENDPOINT: API endpoint for syncing followers
echo - API_TOKEN: API authentication token
pause
) else (
echo .env.example file not found
pause
exit /b 1
)
)
:: Run the application
echo Starting Twitter Follower Tracker...
python src/main.py
:: Keep window open if there's an error
if errorlevel 1 (
echo Application exited with an error
pause
)