Skip to content

Commit

Permalink
Update scraper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
OmairXcluesiv committed Feb 6, 2017
1 parent 3e5d820 commit b63af5f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions scraper.php
Expand Up @@ -17,9 +17,10 @@
} catch (Exception $e) {
}

function ref_tags($data){

return strip_tags($data);
function data_refine($data){
$st = strip_tags($data);
$ws = preg_replace('/\s+/', '', $st);
return $s;
}

// link of config ebay to get the data
Expand All @@ -39,12 +40,10 @@ function ref_tags($data){

$sno = $i;
echo "Sno: " . $sno . "\n";
echo "Product Title: " . ref_tags($r[$i]) . "\n";
$p_text = strip_tags($m[$i]); // replace all HTML tags with plain text
$no_ws = preg_replace('/\s+/', '', $p_text); // remove one or more than one whitespace from grabbed data
echo "Product Price:" . $no_ws . "\n\n\n\n\n";
echo "Product Title: " . data_refine($r[$i]) . "\n";
echo "Product Price:" . data_refine($m[$i]) . "\n\n\n\n\n";

$articles = array(array('sno' => $sno , 'title' => strip_tags($r[$i]) , 'price' => $no_ws));
// $articles = array(array('sno' => $sno , 'title' => strip_tags($r[$i]) , 'price' => $no_ws));

}
?>
Expand Down

0 comments on commit b63af5f

Please sign in to comment.