Alex Suraci Posted July 27, 2005 Share Posted July 27, 2005 Thanks a lot bejeeboy :D Tested the above script, but.. http://www.mynimal.net/rss/rss-feed.php Link to comment https://www.neowin.net/forum/topic/348463-rss-image-signature/page/2/#findComment-586278389 Share on other sites More sharing options...
benjeeeboy Posted July 27, 2005 Author Share Posted July 27, 2005 (edited) I'm having trouble figuring out what it is. I tried turning on strict error reporting, and it told me one thing that was legal in the language, but not preferred. I changed this, and maybe it fixed the problem. Try this instead: <? error_reporting(2048); $domdoc = new DomDocument; $domdoc->load('http://blog.mynimal.net/?feed=rss2'); $xpath = new DOMXPath($domdoc); $titles = $xpath->query('/*/channel/item/title'); for ($i = 0; $i < $titles->length; $i++) { echo $titles->item($i)->nodeValue; echo '<br>'; } ?> Edited July 27, 2005 by benjeeeboy Link to comment https://www.neowin.net/forum/topic/348463-rss-image-signature/page/2/#findComment-586282418 Share on other sites More sharing options...
Alex Suraci Posted July 27, 2005 Share Posted July 27, 2005 Nope. :( Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /www/g/gfxutopianet/htdocs/rss/rss-feed.php on line 9 Line 9: echo $titles->item($i)->nodeValue; Link to comment https://www.neowin.net/forum/topic/348463-rss-image-signature/page/2/#findComment-586282692 Share on other sites More sharing options...
Techy_ Posted July 27, 2005 Share Posted July 27, 2005 Will this code work on PHP4? I was thinking that the 'try { } catch { }' statments was a new thing in PHP5. I might be getting some hosting in the next few weeks and wanted to use this but they only use PHP4 where I'll be getting hosting. Cheers, -Techy Link to comment https://www.neowin.net/forum/topic/348463-rss-image-signature/page/2/#findComment-586282724 Share on other sites More sharing options...
benjeeeboy Posted July 27, 2005 Author Share Posted July 27, 2005 I have absolutely no idea if it will work on PHP4. In my newer version that I am working on now, i will try to not use exceptions, so it may be compatible. I am just re-learning php now, so it may take a bit to get everything working perfectly but i will add php4 compatibility to my todo list. Link to comment https://www.neowin.net/forum/topic/348463-rss-image-signature/page/2/#findComment-586282766 Share on other sites More sharing options...
benjeeeboy Posted July 28, 2005 Author Share Posted July 28, 2005 (edited) I added a bunch to the test code (please post the results). Maybe this will give more insight into whats wrong so i can fix this and get and moving on the new version. <? $domdoc = new DomDocument; $domdoc->load('http://blog.mynimal.net/?feed=rss2'); $xpath = new DOMXPath($domdoc); $titles = $xpath->query('/*/channel/item/title'); echo "Number of entries: "; echo $titles->length; echo "<br>"; for ($i = 0; $i < $titles->length; $i++) { $itemnode = $titles->item($i); echo $itemnode->nodeName; echo ": "; echo $itemnode->nodeValue; echo '<br>'; } echo "<p>"; echo "other way:"; echo "<br>"; $itemlist = $domdoc->getElementsByTagName('item'); echo "num items: "; echo $itemlist->length; echo "<br>"; for ($j=0;$j<$itemlist->length;$j++) { $item = $itemlist->item($j); $itemtitles = $item->childNodes; for ($k=0;$k<$itemtitles->length;$k++) { if ($itemtitles->item($k)->nodeName=='title') { echo $itemtitles->item($k)->nodeValue; echo '<br>'; } } } ?> Thank you for helping me help you. Edited July 28, 2005 by benjeeeboy Link to comment https://www.neowin.net/forum/topic/348463-rss-image-signature/page/2/#findComment-586283921 Share on other sites More sharing options...
Alex Suraci Posted July 29, 2005 Share Posted July 29, 2005 I added a bunch to the test code (please post the results). Maybe this will give more insight into whats wrong so i can fix this and get and moving on the new version.Thank you for helping me help you. 586283921[/snapback] Same error as before. :( Parse error: parse error, unexpected T_OBJECT_OPERATOR in /www/g/gfxutopianet/htdocs/rss/rss-feed.php on line 30 Line 30: if ($itemtitles->item($k)->nodeName=='title') Link to comment https://www.neowin.net/forum/topic/348463-rss-image-signature/page/2/#findComment-586289818 Share on other sites More sharing options...
TimRogers Posted July 30, 2005 Share Posted July 30, 2005 Your RSS dosen't like this system :p Link to comment https://www.neowin.net/forum/topic/348463-rss-image-signature/page/2/#findComment-586297479 Share on other sites More sharing options...
+StevoFC MVC Posted July 31, 2005 MVC Share Posted July 31, 2005 mine gets the same error. Link to comment https://www.neowin.net/forum/topic/348463-rss-image-signature/page/2/#findComment-586302490 Share on other sites More sharing options...
benjeeeboy Posted August 1, 2005 Author Share Posted August 1, 2005 I must have a special version of php then. That really helps with trying to make this ;) I don't really have much time now anyways. I may get back to it later. Link to comment https://www.neowin.net/forum/topic/348463-rss-image-signature/page/2/#findComment-586305315 Share on other sites More sharing options...
Alex Suraci Posted August 1, 2005 Share Posted August 1, 2005 Thank you for your hard work, benjeeeboy. :) Link to comment https://www.neowin.net/forum/topic/348463-rss-image-signature/page/2/#findComment-586307036 Share on other sites More sharing options...
Recommended Posts