This Python script processes a list of tasks, each containing a URL, to generate a mindmap. It utilizes GPT-3 to categorize the tasks and provide summaries. The script performs the following actions:
- Reads tasks from a JSON file called NoNonsenseNotes_Backup.json which is a backup from
https://f-droid.org/en/packages/com.nononsenseapps.notepad/
- Extracts the URL from each task title.
- Fetches metadata (title and description) for each URL, which is used to update the task title.
- Reads a list of topics from a CSV file.
- Fetches the text content from each URL, limiting it to 3000 characters.
- Sends the text content to GPT-3, requesting a summary and a categorization based on the predefined list of topics.
- Updates an existing mindmap XML file (FreeMind format) with the generated summaries and categories.
- Saves the modified mindmap to a new XML file.
The resulting mindmap is organized with tasks grouped under their respective categories, each task containing a summary generated by GPT-3.