Home › Forums › Back End › help with news feeds › Reply To: help with news feeds
March 1, 2015 at 8:11 pm
#197067
Participant
As far as plug-ins go I’m not sure if there are any for what you’re trying to achieve. I haven’t looked or done the research
Anyhow, if you need help parsing the RSS, you can do something like:
# This would come from the form request
# http://localhost.dev/?request=Michigan%20Crime
# $request = $_GET["request"];
$request = 'Michigan%20Crime';
$rss_feed= implode(file('https://news.google.com/news?q='.$request.'&output=rss'));
$xml = simplexml_load_string($rss_feed);
$json = json_encode($xml);
$rss= json_decode($json,TRUE);
foreach($rss["channel"]["item"] as $item) {
// var_dump($item);
echo '<h3><a href="'.$item["link"].'">'.$item["title"].'</a></h3>';
}