Skip to content

Instantly share code, notes, and snippets.

@robertbrook
Created April 1, 2011 14:49
Show Gist options
  • Save robertbrook/898260 to your computer and use it in GitHub Desktop.
Save robertbrook/898260 to your computer and use it in GitHub Desktop.
$feedUrl = 'http://www.theyworkforyou.com/search/rss/?s="'.$thequery.'"';
$rawFeed = file_get_contents($feedUrl);
$xml = new SimpleXmlElement($rawFeed);
foreach ($xml->channel->item as $item)
{
echo "<article>";
echo '<p><a title="'.$item->link.'" href="'.$item->link.'">'.$item->title.'</a><!-- <br/><span class="abstract">' . $item->description . '</span> -->';
$url = (parse_url($item->link));
echo '<br/><span class="url"><strong>'.$url['host'].'</strong>'.$url['path'].$url['query'].'</span></p>';
echo "</article>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment