I\'m trying to read an RSS feed from Flickr but it has some nodes which are not readable by Simple XML (media:thumbnail, flickr:profile, and so on)
An even simpler method using PHP of accessing namespaced XML nodes without declaring a namespace is....
In order to get the value of
-
My important article
Mon, 29 Feb 2017 00:00:00 +0000
https://myxmlsource.com/32984
https://myxmlsource.com/32984
Blogs, Jo
Human Affairs
4f329b923419b3cb2c654d615e22588c
hIwW14tLc+4l/oo7agmRrcjwe531u+mO/3IG3xe5jMg=
/32984/Download/0032984-11042.docx
Journal article
Blogs, Jo
0
Use the following code:
$rss = new DOMDocument();
$rss->load('https://myxmlsource.com/rss/xml');
$nodes = $rss->getElementsByTagName('item');
foreach ($nodes as $node) {
$title = $node->getElementsByTagName('title')->item(0)->nodeValue;
$author = $node->getElementsByTagName('author')->item(0)->nodeValue;
$authorHash = $node->getElementsByTagName('authorHash')->item(0)->nodeValue;
$department = $node->getElementsByTagName('department')->item(0)->nodeValue;
$email = decryptEmail($node->getElementsByTagName('authorEmail')->item(0)->nodeValue);
}