Skip to content

Commit

Permalink
Update scraper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsuarezm committed May 27, 2015
1 parent 9c02d2a commit c4105db
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scraper.php
Expand Up @@ -42,9 +42,9 @@
findAnnounces ($domCentre);
//look for the next page link
$value = "";
// foreach($domCentre->find('.next') as $data){
// $value = $data->href;
// }
foreach($domCentre->find('.next') as $data){
$value = $data->href;
}
}

/***************** Functions *********************/
Expand All @@ -58,7 +58,7 @@ function findAnnounces($strDataDom){
$htmlContent = scraperWiki::scrape($value);
//look for the start of the json record wich has all the information of the announce
//and manually trim it to the correct json format
echo $htmlContent;
//echo $htmlContent;
$strStart = strpos($htmlContent, "initGoogleMap");
$strEnd = strpos($htmlContent, "#containerGoogleMap");

Expand All @@ -79,8 +79,7 @@ function storeJson($strData){
$jsonVar = json_decode($strData);
//echo $strData;
//if the decode ended with no error
if (false){
//if (json_last_error() === JSON_ERROR_NONE) {
if (json_last_error() === JSON_ERROR_NONE) {
$record["id"] = $jsonVar -> id;
$record["price"] = $jsonVar -> price;
$record["location"] = $jsonVar -> location;
Expand Down

0 comments on commit c4105db

Please sign in to comment.