ZhParkingBot is a Telegram bot designed to assist users in finding parking spaces in Zürich by providing real-time data from the PLS Zürich RSS Feed. This data includes the current availability of parking spots in various parking houses, as well as their open/closed status.
You can start interacting with the bot directly by clicking here: @ZhParkingBot on Telegram.
The bot uses location-based services to help users find the nearest parking houses to their shared location. It calculates the distance between the user and the parking houses and provides detailed information, including:
- Address: The exact location of the parking house.
- Price: Information about parking costs.
- Distance: The distance from the user to each parking house.
- Availability: Current free spots in real-time.
Additionally, the bot includes direct navigation links for each parking house, making it easy to open the location in a navigation app and drive directly there.
- Real-Time Parking Updates: Retrieves live parking availability data.
- Location-Based Search: Users can find nearby parking spaces by sharing their location.
- Detailed Information: Displays pricing, occupancy rates, distance, and operating hours.
- Navigation Links: Offers links to navigation apps for selected parking locations.
- CI/CD Integration: Automatically deploys updates with GitHub Actions.
- Python: Core bot logic and data processing.
- Telegram Bot API: User interaction and messaging.
- Ansible: Automates deployment on the server.
- GitHub Actions: Enables continuous integration and deployment.
- BeautifulSoup & Requests: Parses parking data from the PLS Zürich RSS feed.
- Geopy: Calculates distances for location-based parking recommendations.
ZhParkingBot/
├── ansible/
│ ├── inventory.ini # Ansible inventory file
│ ├── deploy_bot.yml # Main playbook
│ └── deploy/
│ ├── bot.service # Systemd service for the bot
│ └── .env # Environment variables (excluded from Git)
├── bot.py # Main bot logic
├── data_fetcher.py # Module for fetching and parsing parking data
├── requirements.txt # Python dependencies
├── .gitignore # Excludes sensitive files
└── README.md # Documentation
- A server (e.g., Ubuntu VPS) with Ansible installed.
- A GitHub repository with SSH access to your server.
- Python 3.8+ installed on the server.
git clone https://github.com/<YOUR_USERNAME>/<REPO_NAME>.git
cd <REPO_NAME>
Edit ansible/inventory.ini
to include your server's IP and username:
[zh_parking_bot]
<YOUR_SERVER_IP> ansible_user=deployuser
Run the Ansible playbook:
ansible-playbook -i ansible/inventory.ini ansible/deploy_bot.yml
GitHub Actions workflow (.github/workflows/deploy.yml
) automates deployment on every push to the main
branch.
Update the workflow file to include your server details and add your SSH private key as a GitHub secret (SSH_PRIVATE_KEY
).
- Open Telegram and start a conversation with the bot by clicking this link: @ZhParkingBot.
- Send
/start
to begin interacting with the bot. - Share your location with the bot, and it will respond with nearby parking options, including:
- Address
- Price
- Distance
- Availability
- Click on the provided navigation link to get directions to the parking spot.
- SSH Keys: Use GitHub Secrets to securely manage SSH private keys for CI/CD.
- Environment Variables: Store sensitive data like API keys in
.env
files, excluded from version control. - Server Hardening: Use a firewall (e.g., UFW) and regularly update server packages.
This project is licensed under the MIT License. See the LICENSE
file for details.
For questions or feedback, feel free to reach out.