Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $xml = simplexml_load_file($baseUrl) or die("The feed did not load!");
- // Get the XML and store as their respective variables.
- $xml_query = $xml->query; // The data contained in the <query> tag from the xml response
- $location = $xml->location; // Location searched.
- $totalResults = $xml->totalresults;
- $starts = $xml->start; // First result shown on page
- $end = 5; // Last result shown on page
- $ursl = $xml->results->result->xml;
- /*
- $jobTitles = $xml->results->result->jobtitle;
- $companys = $xml->results->result->company;
- $citys = $xml->results->result->city;
- $states = $xml->results->result->state;
- $countrys = $xml->results->result->country;
- $dates = $xml->results->result->date;
- */
- for ($start = 1; $start <= $end; $start++) {
- $jobTitles = $xml->results->result->jobtitle;
- foreach($jobTitles as $jobTitle) {
- echo "<p align=\"center\"><b><a href=" . $url . ">" . $jobTitle . "  -   ";
- }
- $companys = $xml->results->result->company;
- foreach($companys as $company) {
- echo $company . "</a></b><br>";
- }
- $citys = $xml->results->result->city;
- foreach($citys as $city) {
- echo $city . ", ";
- }
- $states = $xml->results->result->state;
- foreach($states as $state) {
- echo $state . ", ";
- }
- $countrys = $xml->results->result->country;
- foreach($countrys as $country) {
- echo $country . "       ";
- }
- $dates = $xml->results->result->date;
- foreach($dates as $date) {
- echo "<b>|</b>       " . $date . "</p>";
- }
- $descriptions = $xml->results->result->snippet;$urls = $xml->results->result->url;
- foreach($descriptions as $description) {
- echo "<p>" . $description . "</p>";
- }
- }
Add Comment
Please, Sign In to add comment