Created
October 13, 2010 22:11
-
-
Save jmccartie/625045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Moving to Oklahoma City</title> | |
<? | |
function listitems($url) { | |
$buffer = file_get_contents($url); | |
$xml = new SimpleXMLElement($buffer); | |
echo "<ul>"; | |
foreach ($xml->item as $item){ | |
$ns_dc = $item->children('http://purl.org/dc/elements/1.1/'); | |
echo '<li><a href="' . $item->link. '">' . $item->title . '</a> (' . date('M jS' , strtotime($ns_dc->date)) . ')</li>'; | |
} | |
echo "</ul>"; | |
} | |
?> | |
</head> | |
<body> | |
(all entries searched for require pics, and have ranges from $650-800/mo) | |
<h1>2 Bedroom</h1> | |
<h2>Edmond</h2> | |
<? listitems('http://oklahomacity.craigslist.org/search/apa?query=edmond&srchType=A&minAsk=650&maxAsk=800&bedrooms=2&hasPic=1&format=rss'); ?> | |
<h2>NorthWest</h2> | |
<? listitems('http://oklahomacity.craigslist.org/search/apa?query=NW&srchType=A&minAsk=650&maxAsk=800&bedrooms=2&hasPic=1&format=rss'); ?> | |
<h2>Oklahoma City</h2> | |
<? listitems('http://oklahomacity.craigslist.org/search/apa?query=oklahoma+city&srchType=A&minAsk=650&maxAsk=800&bedrooms=2&hasPic=1&format=rss'); ?> | |
<h1>3 Bedroom</h2> | |
<h2>Edmond</h2> | |
<? listitems('http://oklahomacity.craigslist.org/search/apa?query=edmond&srchType=A&minAsk=650&maxAsk=800&bedrooms=3&hasPic=1&format=rss'); ?> | |
<h2>NorthWest</h2> | |
<? listitems('http://oklahomacity.craigslist.org/search/apa?query=NW&srchType=A&minAsk=650&maxAsk=800&bedrooms=3&hasPic=1&format=rss'); ?> | |
<h2>Oklahoma City</h2> | |
<? listitems('http://oklahomacity.craigslist.org/search/apa?query=oklahoma+city&srchType=A&minAsk=650&maxAsk=800&bedrooms=3&hasPic=1&format=rss'); ?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment