|
@@ -0,0 +1,61 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Console\Commands;
|
|
|
+
|
|
|
+
|
|
|
+use Illuminate\Console\Command;
|
|
|
+class baiduCommand extends Command
|
|
|
+{
|
|
|
+
|
|
|
+ * The name and signature of the console command.
|
|
|
+ *
|
|
|
+ * @var string
|
|
|
+ */
|
|
|
+ protected $signature = 'baidu';
|
|
|
+
|
|
|
+
|
|
|
+ * The console command description.
|
|
|
+ *
|
|
|
+ * @var string
|
|
|
+ */
|
|
|
+ protected $description = '百度站长推送';
|
|
|
+
|
|
|
+
|
|
|
+ * Create a new command instance.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
+ parent::__construct();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * Execute the console command.
|
|
|
+ *
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function handle()
|
|
|
+ {
|
|
|
+ $urls = array(
|
|
|
+ 'https://www.jhcs888.com/#/Home',
|
|
|
+ 'https://www.jhcs888.com/#/AboutUs',
|
|
|
+ 'https://www.jhcs888.com/#/NewDetail?id=3',
|
|
|
+ 'https://www.jhcs888.com/#/NewDetail?id=5',
|
|
|
+ );
|
|
|
+ $api = 'http://data.zz.baidu.com/urls?site=https://www.jhcs888.com&token=AhKx7OpIGiJFvpEK';
|
|
|
+ $ch = curl_init();
|
|
|
+ $options = array(
|
|
|
+ CURLOPT_URL => $api,
|
|
|
+ CURLOPT_POST => true,
|
|
|
+ CURLOPT_RETURNTRANSFER => true,
|
|
|
+ CURLOPT_POSTFIELDS => implode("\n", $urls),
|
|
|
+ CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
|
|
|
+ );
|
|
|
+ curl_setopt_array($ch, $options);
|
|
|
+ $result = curl_exec($ch);
|
|
|
+ dd($result);
|
|
|
+
|
|
|
+ }
|
|
|
+}
|