#!/bin/bash # Variables: # Files: source_file="Dev_Log/Dev_Log.html" target_file="Feed/RSS.xml" # Description getter Counter: line_counter=0 # CleanUP RSS-Feed: > "$target_file" # Prepair Feed: echo "" >> "$target_file" echo "" >> "$target_file" echo " " >> "$target_file" echo " ProjectCWC - Development Log" >> "$target_file" echo " https://projectcwc.catwithcode.moe/Dev_Log/Dev_Log.html" >> "$target_file" echo " Development Log for there upcoming Immersiv Sim ProjectCWC." >> "$target_file" # Extract text between

and

and write to target file: while IFS= read -r line; do # Check if line is Title: if [[ $line =~ \(.*)\<\/h2\> ]]; then # Extract the text between

: text="${BASH_REMATCH[1]}" # Write to Tags: echo " " >> "$target_file" # Write actual Text: echo " $text" >> "$target_file" # Write to Tags: echo " https://projectcwc.catwithcode.moe/Dev_Log/Dev_Log.html" >> "$target_file" fi # If just wrote Titel then: if [[ $(tail -n 1 "$target_file") == " https://projectcwc.catwithcode.moe/Dev_Log/Dev_Log.html" ]]; then # Get actual Text: line_counter=$((line_counter + 1)) # After 3 lines, write the current line to the target file: if [ $line_counter -eq 3 ]; then # Reset: line_counter=0 # Write Disc. and Tags: echo " $line" >> "$target_file" echo " " >> "$target_file" fi fi done < "$source_file" # Closing Tags: echo "
" >> "$target_file" echo "
" >> "$target_file" # Clean the target file by removing HTML-Tags: # u: sed -i 's///g; s/<\/u>//g' "$target_file" # h3: sed -i 's/

//g; s/<\/h3>//g' "$target_file" # Done: echo "Extraction complete. Check $target_file for results."