Building a Python App for Real-Time Notifications: CamAlert
Are you tired of constantly checking online marketplaces for new listings of your favorite items? Look no further – with CamAlert, a Python 3 application, you can receive real-time notifications whenever there’s a new analog camera available on 2dehands, the eBay of Belgium.
CamAlert runs silently in the background on macOS, regularly scanning 2dehands for fresh deals. Once it finds a new listing, it sends a system notification to your desktop, providing you with the listing title and price. You can even customize the category of listings you want to receive notifications for, making this app perfect for broader use beyond analog cameras in the future.
Key Features
- Background check for new listings every 60 seconds
- System notifications with listing details for new findings
- Option to open all new listings in the default browser
- Convenient status bar menu with various options:
- Clear all new listings
- Manual check for new listings
- Blocklist to filter out certain words or sellers
- Reset option
- Check for updates
- About info
- Quit the application
- Alert notification when opening more than 10 new listings at once, allowing users to cancel the action if necessary
The app currently checks the 100 most recent listings for new additions. However, you can customize this value by modifying the numberOfListings
variable in the update()
function.
System Requirements
To build the CamAlert app yourself, you’ll need the following:
- Python 3
- The
py2app
package, which you can install viapip install py2app
- The latest version of
rumps
(0.4.0), which you can install by following the instructions found here
Building the App
Once you have the necessary requirements, you’re ready to build the CamAlert app. Follow these steps:
- From the root of the project folder, run
python setup.py py2app -A
in the terminal to compile the app in Alias mode. The app will be available for testing in thedist
folder. - If the app works as expected, and you want to create a standalone version, remove the
build
anddist
folders using the commandrm -rf build dist
. Then, runpython setup.py py2app
to build the standalone version of the app, which will also be located in thedist
folder.
Conclusion
CamAlert offers a seamless solution for staying up to date with new listings on 2dehands. Whether you’re a camera enthusiast or looking to apply this concept to other types of listings, this Python app provides a solid foundation for real-time notifications. Feel free to explore the source code and adapt it to suit your needs.
If you have any questions or need further assistance, please feel free to reach out. Happy coding!
Leave a Reply