Created
October 5, 2016 15:26
-
-
Save cakriwut/e3c213a49082f835292dcfb87d923930 to your computer and use it in GitHub Desktop.
How to download URL news link from detik.com using RSS feed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Defines file capture location | |
$fileCapture = "C:\temp\detik.txt" | |
# List of target RSS - you can add more | |
$targetRSS = "detikcom_nasional", "detikcom_internasional", "detikcom_bbc","detikcom_lapsus","detikcom_wawancara"," detikcom_prokontra" | |
$targetRSS |% { | |
$url = "http://rss.detik.com/index.php/" + $_ | |
$targetXml = "C:\temp\" + $_ + ".xml" | |
Invoke-WebRequest -Uri $url -OutFile $targetXml -ErrorAction Stop | |
[xml]$Content = gc $targetXml | |
$Feed = $Content.rss.channel | |
$Feed.Item |% { | |
$msg = $_ | |
Add-Content $detikLink $msg.link | |
} | |
# Clean-up temporary file | |
Remove-Item $targetXml -Force -ErrorAction Ignore | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I document consuming detik.com RSS feeds and extract URL links. This method is not preferable. Use DetikApi.ps1 instead