diff --git a/examples/whatsapp-calendar-automation/README.md b/examples/whatsapp-calendar-automation/README.md new file mode 100644 index 0000000..e22cd1d --- /dev/null +++ b/examples/whatsapp-calendar-automation/README.md @@ -0,0 +1,20 @@ +# WhatsApp to Google Calendar Automation (DroidRun Example) + +This example demonstrates how to use DroidRun / MobileRun to: + +- Open WhatsApp on Android +- Scan recent chat messages for meeting info (date, time, intent) +- Extract relevant details +- Create Google Calendar events automatically +- Repeat the process periodically + +## Tech Stack + +- Python +- DroidRun (MobileRun) + +## How to Run + +1. Install requirements: +```bash +pip install -r requirements.txt diff --git a/examples/whatsapp-calendar-automation/main.py b/examples/whatsapp-calendar-automation/main.py new file mode 100644 index 0000000..7b71ebb --- /dev/null +++ b/examples/whatsapp-calendar-automation/main.py @@ -0,0 +1,40 @@ +import asyncio +from droidrun import DroidAgent, DroidrunConfig + +WHATSAPP_CALENDAR_GOAL = """ +Open the WhatsApp app on the Android device. +Scan recent chat messages to identify messages that contain meeting-related +information such as date, time, or meeting intent. + +When such information is detected: +- Extract the relevant details (date, time, title, description) +- Open the Google Calendar app +- Create a new calendar event with the extracted meeting information + +After creating the event: +- Return to WhatsApp +- Continue scanning other messages +- Repeat the process until all important messages are covered + +If no meeting-related messages are found: +- Wait for a while +- Repeat the scanning process periodically +""" + +async def main(): + config = DroidrunConfig() + + agent = DroidAgent( + goal=WHATSAPP_CALENDAR_GOAL, + config=config, + ) + + result = await agent.run() + + print("\n===== AUTOMATION RESULT =====") + print(f"Success: {result.success}") + print(f"Reason: {result.reason}") + print(f"Steps taken: {result.steps}") + +if __name__ == "__main__": + asyncio.run(main())