示例#1
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $url = $request->url_string;
     re_scrape($url);
     $CrawlerDetect = new CrawlerDetect();
     if ($CrawlerDetect->isCrawler()) {
         return;
     } else {
         return $next($request);
     }
 }
示例#2
0
 public function test()
 {
     $products = Product::whereBetween('id', [0, 50])->get();
     foreach ($products as $product) {
         re_scrape(url('/post/' . convert_vi_to_en($product->description) . '-' . $product->id));
     }
     return 'done';
 }