473,396 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

reading Rss Feed

omerbutt
638 512MB
hi i am trying to display videos from an rss feed , every thing was working fine then atonce every thing stopped working and i started receiving error
Expand|Select|Wrap|Line Numbers
  1. Warning: DOMDocument::load() [domdocument.load]: Start tag expected, '<' not found in http://www.paksiasat.com/feed/, line: 1 in M:\xamp2\xampp\htdocs\entertainment\home.php on line 6
  2.  

my code is as follows
Expand|Select|Wrap|Line Numbers
  1. $doc = new DOMDocument();
  2.         //$doc_thumb = new DOMDocument();
  3.         $doc->load("http://www.paksiasat.com/feed/");
  4.  
  5.         //$doc_thumb->load("http://www.paksiasat.com/feed/");
  6.         ?>    <!-- content -->
  7.  
  8.                     <div class="subfeatures">
  9.                         <div class="subfeatures-inner">
  10.                             <ul>
  11.                                 <?php 
  12.                                 foreach($doc->getElementsByTagName('item') as $node){
  13.                                     $rss = array (
  14.                                         'title' => $node->getElementsByTagName('title')->item($counter)->nodeValue,
  15.                                         'description' => $node->getElementsByTagName('description')->item($counter)->nodeValue,
  16.                                         'link' => $node->getElementsByTagName('link')->item($counter)->nodeValue,
  17.                                         'date' => $node->getElementsByTagName('pubDate')->item($counter)->nodeValue,
  18.                                         'comments' => $node->getElementsByTagName('comments')->item($counter)->nodeValue,
  19.                                         'content' => $node->getElementsByTagName('encoded')->item($counter)->nodeValue,
  20.                                         'guid' => $node->getElementsByTagName('guid')->item($counter)->nodeValue
  21.                                         );
  22.  
  23.                                         echo '
  24.                                                 <li class="subfeature">
  25.                                                 <a href="'.$rss['guid'].'" title="'.$rss['title'].'" class="" style="">
  26.                                                 <img src="http://localhost:8080/wordpress/wp-content/themes/wave/thumb.php?src=/wp-content/themes/wave/images/placeholder-subfeature.jpg&amp;w=158&amp;h=116&amp;zc=1&amp;q=95" alt="'.$rss['title'].'">
  27.                                                 <span>&nbsp;'.$rss['title'].'</span>
  28.                                                 </a></li>
  29.                                             ';
  30.                                  }
  31.                                  ?>
  32.                             </ul>
  33.                         </div>
  34.                     </div>
  35.  
Jun 6 '12 #1

✓ answered by Dormilich

I’m not entirely sure if ->load() supports loading from an URL. the Manual only mentions files from the filesystem (but does not explicitly exclude URLs). comment #3 indicates, that load() does not resolve DNS domain names.

if you have allow_url_fopen enabled, you can fetch the XML via file_get_contents().

1 1644
Dormilich
8,658 Expert Mod 8TB
I’m not entirely sure if ->load() supports loading from an URL. the Manual only mentions files from the filesystem (but does not explicitly exclude URLs). comment #3 indicates, that load() does not resolve DNS domain names.

if you have allow_url_fopen enabled, you can fetch the XML via file_get_contents().
Jun 7 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Martman | last post by:
I am new to PHP but testing the ability to read an RSS xml feed. I have successfully retrieved, read, and displayed an RSS feed from pcworld. However, when you click on one of the links it adds...
0
by: Julian | last post by:
I have written a CGI program which takes an RSS feed and turns it into HTML. I'm using it to display the latest headlines from the BBC News website. The question is, what order should I display...
5
by: WebBuilder451 | last post by:
is there ant place where i can learn the basics of reading an rss feed and enumerating through the values? just want to start at the bottom, no frills. thanks -- thanks (as always) some day...
10
by: Visualbomber | last post by:
Hi there, I have been reasearching RSS and XML, in order to form a program that works with RSS to organize information, such as places on a map. Does anyone here have any ideas how I can get this...
1
by: beardiethor | last post by:
Hi All, Thanks for letting me join. I have a question. I just downloaded a free version of an rss software for reading, writing and publishing; I have about 12 days left on it. Had good customer...
6
by: affiliateian | last post by:
Total newbie here for this so please be patient. We manually update our XML feed when we publish an article on our website. Can we add a javascript tracking pixel (from phpadsnew) into the XML...
4
by: Wade | last post by:
Does anyone know where I can get an open source rss feed reader?
1
by: Kalyan | last post by:
Hello all, We read our newsgroup by subscribing it through "Outlook Express". When some body sends an email to me@ourcompany.com it gets displayed in the newsgroup. Is it possible to generate...
5
by: Ed Flecko | last post by:
Hi folks, I'm trying to figure out this whole RSS feed thing. I've created my .xml file to use for my feed, and my browsers "recognize" that I have an RSS feed, and you can subscribe, etc., etc....
4
by: Jake G | last post by:
Hi all, I am trying to get a current weather conditions feed working. Yahoo provides a free feed @ http://weather.yahooapis.com/forecastrss?p=XXXXX where XXXXX is a valid US zip code e.g....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.