- Clone the repository:
git clone https://github.com/yourusername/whatsapp-surf-bot.git
- Install dependencies:
pip install -r requirements.txt
- Set up API keys and configuration (coming soon...)
To run the bot, you'll need to execute two commands in separate terminal windows:
-
In the first terminal, start the bot server:
python run.py
-
In the second terminal, create a public URL with ngrok:
ngrok http 8000 --domain rhino-leading-purely.ngrok-free.app
This setup allows the WhatsApp API to reach your local bot server
This repository contains a chatbot designed to integrate with WhatsApp using the WhatsApp Business API (or alternative methods if group messages are required). The bot will provide surf forecasts for a specific surf spot by gathering data from multiple surf forecasting websites.
The bot will:
- Always respond in Dutch.
- Provide short and to-the-point responses.
- Determine the best time to surf tomorrow for a given surf spot.
- Gather and aggregate forecasts from Surfline, Windguru, and Surf Forecast NL.
- Follow strict rules regarding the information provided (e.g., no temperature details, focus on light, wind, and tides).
- Automated WhatsApp responses.
- Intelligent surf spot identification.
- Web scraping/API integration with surf forecast websites.
- Logging of surf forecasts for debugging and future improvements.
- Custom knowledge base for storing user-contributed insights on surf spots.
Je bent een chatbot die altijd in het Nederlands antwoordt.
- Je antwoorden moeten kort en to the point zijn.
- Jouw taak is om de beste tijd te bepalen om morgen te gaan surfen op een specifieke surfspot door de volgende forecast-websites te raadplegen:
- Surfline
- Windguru
- Surf Forecast NL
- Zorg ervoor dat je correct de windrichting interpreteert. Raadpleeg hiervoor Surf Forecast.
- Geef geen informatie over temperaturen.
- Focus uitsluitend op het moment van de dag waarop de surfcondities het beste zijn.
- Bied een duidelijke beredenering op basis van factoren zoals licht (niet donker), lage wind, meest offshore wind en optimale getijden.
- Als de surfspot onduidelijk is of niet genoemd wordt, stel dan een eenvoudige vervolgvraag om een specifiekere surfspot te verkrijgen.
- Als je niet weet welke getijden of windcondities ideaal zijn voor de betreffende spot, zoek die informatie op via het internet.
- Custom function for processing incoming messages
- Check if the first two characters of the message are
hh. If not, return a default message. - If
hh, check if the message contains a valid surfspot name in each of the following websites: - If no valid surf spot is found, ask for more specifics or suggest another spot.
- If a valid surf spot is found:
- Retrieve the surf forecast for the next day from each website.
- Combine the forecasts into a single response.
- Log the individual forecasts to a file for debugging purposes.
- Check if the first two characters of the message are
- Knowledge Base
- Allow users to contribute their own knowledge about surf spots.
- Use this data to improve surf predictions (e.g., "Scheveningen is best at 2 hours before high tide with an eastern soft wind").
- Improve API/Web Scraping Reliability
- Implement failover strategies in case a website is down.
- Consider alternative data sources for better accuracy.
- Enhance User Experience
- Implement natural language processing to handle varied user queries.
- Develop an easy-to-use interface for updating surf spot knowledge.
Contributions are welcome! If you have suggestions or improvements, please submit a pull request or open an issue.