Jump to content

Problem importing Feed


ravi181229

Recommended Posts

Hi

I have a problem with importing a feed.

$feed = "http://feeds.feedburner.com/wnbc/video";

 

I tried with following code:

$rss_feed = file_get_contents($feed);

$KNBC = new SimpleXMLElement($rss_feed);

$casts = $KNBC->channel->item;

 

but it returns past events, it does not return today's events.

 

I tried with cURL:

 

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,'http://feeds.feedburner.com/wnbc/video');

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$contents = curl_exec ($ch);

curl_close ($ch);

$KNBC = new SimpleXMLElement($contents);

$casts = $KNBC->channel->item;

echo $casts;

 

but it does not return anything.

 

need Help.

Thanks in advance.

 

Link to comment
https://forums.phpfreaks.com/topic/108747-problem-importing-feed/
Share on other sites

I'm seeing the exact same thing. I think they have some sort of check in place to see who is fetching it, and if it's a script, it feeds them old data.  I just got this whole feed:

<html xml:lang="en" lang="en">
<head>
  <title>wnbc.com - Video</title>
</head>
<body>

<h1>wnbc.com - Video</h1>

<h2><a href='http://video.wnbc.com/player/?id=258901'>Cigarette Tax Rises</a></h2>
<p>Some smokers say the increased tax may be enough to quit.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/304162389" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=259050'>Murder For Hire Plot Stretches Over 2,000 Miles</a></h2>
<p>Police say three suspects plotted to kill an entire family.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/304204014" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258962'>City May Have Known Of Deadly Crane's Past Cracking Problems Before Collapse</a></h2>
<p>Insurance officials for the crane company tell News 4 New York that city building inspectors signed off on the repairs to the crane certifying the crane was safe.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/304171048" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=259051'>Avoiding Hidden Credit Card Fees</a></h2>
<p>It can be easy to run into a number of credit card fees.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/304204015" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258516'>Bank Destroyed By Powerful Twister</a></h2>
<p>Security video captures incredible footage of a tornado striking a bank in Iowa.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303845936" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258412'>Shuttle Docks With Space Station</a></h2>
<p>Space shuttle Discovery arrives at the international space station after performing a slow back flip for inspection.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303669395" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258499'>Could Clinton's Campaign Be Almost Over?</a></h2>
<p>Barack Obama plans to mark the end of primary season Tuesday night in Minnesota, and Hillary Rodham Clinton's campaign is sending signals she may soon end her White House run, NBC News reported.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303807732" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258157'>Lakers Vs. Celtics Final Stirs Up Memories</a></h2>
<p>Mike Francesa previews the NBA Finals match up between two historic basketball franchises.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303861997" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258398'>Explosives Probe In Oakland</a></h2>
<p>Explosive materials are found in an Oakland home, sources say.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303669396" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258395'>Elderly Man Hit In Brooklyn</a></h2>
<p>The search is on for a driver who hit an elderly pedestrian and then shook the injured man from the car.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303660062" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258333'>Academy Award Winner Charged With Cocaine Possession</a></h2>
<p>She said nothing, but her face could not hide the pain as she left court Monday.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303385358" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258397'>Hillary Heads Home For Major Speech</a></h2>
<p>Hillary Clinton will speak at Baruch Tuesday night in New York, and speculation mounts that she will end her bid for the White House.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303660061" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258298'>Crane Crushes American Dream</a></h2>
<p>The cousin of one of the two men killed in last weekÂ’s crane collapse says the disaster should never have happened and that people must be held accountable.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303385359" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258312'>Rock Icon Remembered</a></h2>
<p>The rock icon died in his Florida home after months of health problems. He was 79 years old.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303385360" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258363'>Fashion Designers Honor Their Best</a></h2>
<p>The Council of Fashion Designers honors the best and brightest in the fashion world at a red carpet event.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303767472" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258344'>Yves Saint Laurent Influence Lives On</a></h2>
<p>Yve Saint Laurent, 71, died Sunday night at his Paris home after a yearlong battle with brain cancer.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303358921" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258112'>Bo Diddley Dies At 79</a></h2>
<p>Bo Diddley, a founding father of rock 'n' roll, died Monday after months of ill health.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303316112" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258329'>Struggling To Escape Gym Memberships</a></h2>
<p>Experts say it is not impossible to modify gym memberships when low on financial resources.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303401913" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258295'>Sree Advice: Teaching Your Kids About Money</a></h2>
<p>The Internet offers many Web sites geared towards teaching kids the value of a dollar.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303385361" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258043'>Primary Season To Finally Wind Down</a></h2>
<p>After a weekend decision by Democratic party officials that could be a major blow to Sen. Hillary Rodham Clinton's campaign, it's now down to the wire as voters head to the polls in South Dakota and Montana.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303316113" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=257990'>Movie Lot Fire Destroys Hollywood Memories</a></h2>
<p>The Universal Studios back lot looked more like the set of a Hollywood disaster movie last weekend.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303060602" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258093'>Raw Video: Tatum O'Neal Leaves Jail</a></h2>
<p>Actress Tatum O'Neal leaves jail after getting arrested for allegedly trying to buy cocaine and crack from a street dealer.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303139866" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258151'>Thong-Wearing Robbers Caught On Tape</a></h2>
<p>Police in a small Colorado town are searching for two robbers who robbed a convenience store while wearing thong panties as masks.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303173260" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=258122'>2 Minute Drill: 6/2</a></h2>
<p>Mike Francesa answers viewer emails on the Belmont Stakes, the Tampa Bay Rays, Carlos Delgado and more!<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/303316114" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=257857'>Woman, 26, Found Slain In Bathtub</a></h2>
<p>Police believe the boyfriend of a woman found with her throat cut in a New York City bathtub was responsible for her death before he jumped to his own.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/302595883" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=257938'>O'Neal Arrested In Drug Bust</a></h2>
<p>Police say Oscar-winning actress Tatum O'Neal has been arrested for buying crack cocaine on the Lower East Side.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/302960539" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=257932'>D.A. To Probe Crane Collapse</a></h2>
<p>The D.A.'s office will investigate Friday's deadly crane collapse.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/302940261" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=257880'>Families Want Answers In Fatal Scaffolding Accident</a></h2>
<p>The families of two workers killed when their scaffold collapsed while working at a Bayonne industrial plant want to know what went wrong.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/302595884" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=257876'>Massive Blaze Devours Universal Studios</a></h2>
<p>A massive fire at Universal Studios in Los Angelies destroyed roofs, movie sets and reels, and kept firefighters busy for hours.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/302587854" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=257954'>Credit Card Rewards For Gas Money</a></h2>
<p>Tips on how your credit card reward program might earn you money at the pump.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/302949197" height="1" width="1"/></p>

<h2><a href='http://video.wnbc.com/player/?id=257930'>Best Bets For Sunglasses</a></h2>
<p>Get tips on finding the best sunglass style to flatter your face.<img src="http://feeds.feedburner.com/~r/wnbc/video/~4/302940262" height="1" width="1"/></p>


</body>
</html>

It refuses to show the script the "current news file".

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.