- Add 'weather' to the 'all' array, allowing inclusion of weather information in the generated text.
- Create directories /sdcard/.mp3/ and /sdcard/.text/ to store MP3 and text files respectively.
- Update txt_dir and mp3_dir paths to use /sdcard/ instead of /root/iobroker_scripts/general/.
- Modify the 'generate_text' function to include weather information in both German and Spanish.
- Create an HTML file (handout.html) for better presentation of text information.
- Style the HTML content with a table for improved readability.
- Add processing messages for each component during HTML generation.
- Extract IP address retrieval into a separate function 'check_ip'.
- Transfer the HTML and text files to A72's /sdcard/ directory using SCP.
- Start 'generate_mp3.sh' on A72 asynchronously using nohup.
- Refactored HTML file creation with Markdown content construction for clarity and conciseness.
- Removed the HTML file generation block and replaced it with a Markdown content string.
- Updated the notification mechanism using the constructed Markdown content and a curl command.
- Display the constructed Markdown content instead of the HTML file.
- Updated the file transfer destination to the A72 device's /sdcard/ directory for generate_text.sh.
The generate_text.sh script has been modified with the following changes:
- Updated the variable name 'markdown_file' to 'html_file' to reflect the change in the file format from Markdown to HTML.
- Modified the HTML structure to create a formatted table for the handout, enhancing readability and presentation.
- Added inline CSS styling to the HTML file to improve the table layout and appearance.
These changes improve the generate_text.sh script by switching from Markdown to HTML for better presentation and readability of the handout. Additionally, the HTML table is now more structured and visually appealing.
The commit also includes the removal of the previous notification-related code, which was commented out and not in use.
The goal is to enhance the script's functionality and improve the presentation of the generated handout in HTML format.
Addition of Markdown File:
- Introduce a Markdown file 'handout.md' to store information in a structured format.
- Markdown file is created with headers, columns, and content for German and Spanish text.
Refactoring and Cleanup:
- Declare 'markdown_file' variable to store the path of the Markdown file.
- Introduce 'all' array to store components like 'date' and 'time'.
- Clear files in 'text_dir' at the beginning to ensure a clean start.
File Transfer and Notification:
- Use 'scp' to transfer files to A72, maintaining the directory structure.
- Enhance the curl command to include the Markdown file as an attachment.
- Set the 'Filename' header for better identification on the server.
- Display the constructed curl command for visibility.
- Execute the curl command to send a high-priority notification with the Markdown file.
Logging and Output:
- Display the content of the generated Markdown file.
- Initiate 'generate_mp3.sh' on A72 in the background.
Note: Adjusted the output formatting for better readability in the commit message.
- Author: Michael Haider
- Created on: 26.01.2024
- Description: This script generates various text files with information such as date, time, news, and weather in German and Spanish.
- The script includes functions to check the IP address of Lisa's iPhone, generate text files in German and Spanish, transfer files to the A72 device, and start generate_mp3.sh on the A72.
- The generated texts are outputted in both German and Spanish.