diff --git a/scripts/update_link_lite_json.ps1 b/scripts/update_link_lite_json.ps1 index 8a5e341e..f9d08b05 100644 --- a/scripts/update_link_lite_json.ps1 +++ b/scripts/update_link_lite_json.ps1 @@ -48,6 +48,7 @@ foreach ($line in $content) { name = $matches[1].Trim() url = "" image = "" + rss = "" } } # Match properties @@ -62,6 +63,9 @@ foreach ($line in $content) { # Handle 'avatar' key just in case $currentFriend.image = $matches[1].Trim() } + elseif ($line -match "^\s*(rss|feed):\s*(.+)") { + $currentFriend.rss = $matches[2].Trim() + } } } # Add the last one @@ -71,12 +75,17 @@ if ($currentFriend -and $currentFriend.name -and $currentFriend.url) { Write-Host "Found $($friends.Count) friends." -# Convert to requested format: ["name", "url", "image"] +# Convert to requested format: ["name", "url", "image", "rss"(optional)] $outputList = @() foreach ($f in $friends) { # Use image if available, otherwise empty string or default $img = if ($f.image) { $f.image } else { "" } - $outputList += ,@($f.name, $f.url, $img) + + if ($f.rss) { + $outputList += ,@($f.name, $f.url, $img, $f.rss) + } else { + $outputList += ,@($f.name, $f.url, $img) + } } $outputData = @{