Skip to content

Commit

Permalink
Updated URL. Grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
marcthenarc committed Mar 21, 2023
1 parent e985508 commit 046a998
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# nhknews_dl
A PHP script to download daily japanese podcasts from NHK news.
Read the COPYING file for my very permissive and delicious license.

Changes:

2023-03-21
----------

Updated the XML source instead of relying on the redirection.



6 changes: 3 additions & 3 deletions nhknews_dl.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
you think this stuff is worth it, you can buy me a beer in return.
*/

# Get file for the NHK website.
# Get file from the NHK website.
$xml = file_get_contents(
"https://www.nhk.or.jp/r-news/podcast/nhkradionews.xml");
"https://www.nhk.or.jp/s-media/news/podcast/list/v1/all.xml");

# Parse file for all http:// references to mp3 files.
preg_match_all("/https:\/\/.*\.mp3/", $xml, $out, PREG_SET_ORDER);
Expand All @@ -21,7 +21,7 @@
# Keep the URL.
$url = $values[0];

# We much know the name of each individual file so that we check if we
# We must know the name of each individual file so that we check if we
# already have it. Split each url from slashes. The last one is it.
$slashes = explode('/', $url); $filename = array_pop($slashes);

Expand Down

0 comments on commit 046a998

Please sign in to comment.