Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $_SERVER['DOCUMENT_ROOT'] = $_SERVER['DOCUMENT_ROOT'] ?: dirname( dirname(
- (dirname(__FILE__))));
- $_SERVER['REMOTE_ADDR'] = "127.0.0.1";
- $filename = file($_SERVER['DOCUMENT_ROOT'].'/sitemap.txt');
- $idF = 0;
- foreach($filename as $key=>$value)
- {
- if($key != 0)
- {
- $page_content = file_get_contents($value);
- preg_match_all('|<span class="js-code">(.*)</span>|sUSi', $page_content, $titles[$idF]['id']);
- preg_match_all('|<h1 class="title">(.*)</h1>|sUSi', $page_content, $titles[$idF]['name']);
- preg_match_all('|<p class="decor_6">(.*)</p>|sUSi', $page_content, $titles[$idF]['description']);
- $titles[$idF]['link'] = $value;
- preg_match_all('|<span class="apiimg">(.*)</span>|sUSi', $page_content, $titles[$idF]['image_link']);
- $titles[$idF]['availability'] = 'in stock';
- preg_match_all('|<span class="price priceOrigVariant oldpr">(.*)</span>|sUSi', $page_content, $titles[$idF]['price']);
- preg_match_all('|<span class="price priceVariant newsales">(.*)</span>|sUSi', $page_content, $titles[$idF]['sale_price']);
- preg_match_all('|<span id="bran65">(.*)</span>|sUSi', $page_content, $titles[$idF]['brand']);
- $titles[$idF]['identifier_exists'] = 'no';
- $titles[$idF]['condition'] = 'new';
- $idF++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement