Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Desc: This file is decoded by PHP Decoder
- * Website: http://phpdecoder.wordpress.com/
- */
- function find_SIN($url) {
- global $nASIN;
- if (strpos($url,"/s/")>0) {
- $arr = explode("?",$url);
- for ($i=1;$i<7;$i++) {
- $url2 = "http://www.amazon.com/gp/search/ref=sr_pg_$i?".$arr[1]."&page=$i";
- echo "<!--".$url2." -->";
- $html = file_get_html($url2);
- foreach($html->find('a.title') as $ul) {
- $arr2 = explode("/",$ul);
- if (trim($arr2[5])!="a>")
- $res[] = trim($arr2[5]);
- }
- if (!is_array($res)) break;
- }
- if (!is_array($res)) {
- for ($i=1;$i<7;$i++) {
- $url2 = "http://www.amazon.com/gp/search/ref=sr_pg_$i?".$arr[1]."&page=$i";
- echo "<!--".$url2." -->";
- $html = file_get_html($url2);
- foreach($html->find('h3.newaps a') as $ul) {
- $arr2 = explode("/",$ul);
- $res[] = trim($arr2[5]);
- }
- if (!is_array($res)) break;
- }
- }
- $nASIN = count($res);
- }
- if (is_array($res))
- return $res;
- $html = file_get_html($url);
- $i=0;
- if (strpos(strtoupper($url),"MOVERS-AND-SHAKERS")>1) {
- foreach($html->find('.zg_title a') as $ul) {
- $arr = explode("/",$ul);
- $res[] = substr($arr[5],0,10);
- }
- $nASIN = count($res);
- }
- if (is_array($res))
- return $res;
- if (strpos(strtoupper($url),"SELLERS")>1 ||strpos(strtoupper($url),'TOP-RATED')>1) {
- $j=0;
- for($i=1;$i<6;$i++) {
- if ($i!=1) {
- $url = str_replace("pg_".($i-1),"pg_".$i,$url);
- $url = str_replace("pg=".($i-1),"pg=".$i,$url);
- $html = file_get_html($url);
- }
- $j=1;
- foreach($html->find('div.zg_title') as $ul) {
- $last = $ul;
- $arr = explode("/",$ul);
- if ($j==1 &&$i!=1)
- $res[] = PHP_EOL.substr($arr[5],0,10);
- else
- $res[] = substr($arr[5],0,10);
- $j++;
- }
- $nASIN = count($res);
- }
- }else {
- foreach($html->find('a.title') as $ul) {
- $arr = explode("/",$ul);
- $res[] = substr($arr[5],0,10);
- }
- $nASIN = count($res);
- }
- if (is_array($res))
- return $res;
- else {
- foreach($html->find('result product') as $ul) {
- $arr = explode("/",$ul);
- $res[] = substr($arr[5],0,10);
- }
- $nASIN = count($res);
- if (is_array($res))
- return $res;
- else
- return "No ASIN ";
- }
- };
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement