@@ -3,10 +3,8 @@ |
||
| 3 | 3 | namespace App\Console\Commands; |
| 4 | 4 | |
| 5 | 5 | use Alaouy\Youtube\Facades\Youtube as Yt; |
| 6 | -use App\Http\Models\Stats; |
|
| 7 | 6 | use App\Http\Models\Videos; |
| 8 | 7 | use Illuminate\Console\Command; |
| 9 | -use Illuminate\Support\Facades\DB; |
|
| 10 | 8 | use Illuminate\Support\Facades\Log; |
| 11 | 9 | |
| 12 | 10 | /** |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | if (!empty($channel)) { |
| 52 | 52 | $manager = new \MongoDB\Driver\Manager("mongodb://localhost:27017"); |
| 53 | 53 | $collection = new \MongoDB\Collection($manager, "laravel.stats"); |
| 54 | - $collection->deleteMany([]); |
|
| 54 | + $collection->deleteMany([ ]); |
|
| 55 | 55 | |
| 56 | 56 | $collection = new \MongoDB\Collection($manager, "laravel.stats"); |
| 57 | 57 | $stat = [ |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | 'maxResults' => 30, |
| 71 | 71 | ]; |
| 72 | 72 | |
| 73 | - $videos = Yt::searchAdvanced($params, true)['results']; |
|
| 73 | + $videos = Yt::searchAdvanced($params, true)[ 'results' ]; |
|
| 74 | 74 | |
| 75 | 75 | if (!empty($videos)) { |
| 76 | 76 | $collection = new \MongoDB\Collection($manager, "laravel.videos"); |
| 77 | - $collection->deleteMany([]); |
|
| 77 | + $collection->deleteMany([ ]); |
|
| 78 | 78 | $now = new \DateTime(); |
| 79 | - $day= $now->getTimestamp(); |
|
| 79 | + $day = $now->getTimestamp(); |
|
| 80 | 80 | |
| 81 | 81 | foreach ($videos as $video) { |
| 82 | 82 | $collection = new \MongoDB\Collection($manager, "laravel.videos"); |
@@ -8,9 +8,7 @@ |
||
| 8 | 8 | use App\Http\Models\Sessions; |
| 9 | 9 | use App\Http\Models\User; |
| 10 | 10 | use Illuminate\Http\Request; |
| 11 | -use Illuminate\Support\Facades\DB; |
|
| 12 | 11 | use Illuminate\Support\Facades\Validator; |
| 13 | -use Netshell\Paypal\Facades\Paypal; |
|
| 14 | 12 | |
| 15 | 13 | /** |
| 16 | 14 | * Class MainController. |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | public function ajaxmovies(Request $request) |
| 38 | 38 | { |
| 39 | 39 | $validator = Validator::make( |
| 40 | - $request->all(), //request all : tous les elements de requetses |
|
| 40 | + $request->all(), //request all : tous les elements de requetses |
|
| 41 | 41 | [ |
| 42 | 42 | 'title' => 'required|min:10', |
| 43 | 43 | ], [ |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $executePayment = $payment->execute($paymentExecution, $this->_apiContext); |
| 79 | 79 | |
| 80 | 80 | // Clear the shopping cart, write to database, send notifications, etc. |
| 81 | - $request->session()->pull('likes', []); |
|
| 81 | + $request->session()->pull('likes', [ ]); |
|
| 82 | 82 | |
| 83 | 83 | return view('Main/index'); |
| 84 | 84 | } |
@@ -99,10 +99,10 @@ discard block |
||
| 99 | 99 | $videos = collect($collection->find()->toArray())->shuffle(); |
| 100 | 100 | |
| 101 | 101 | $collection = new \MongoDB\Collection($manager, "laravel.stats"); |
| 102 | - $youtubeinfo = collect($collection->find(["origin" => "Youtube"])->toArray())->first(); |
|
| 102 | + $youtubeinfo = collect($collection->find([ "origin" => "Youtube" ])->toArray())->first(); |
|
| 103 | 103 | |
| 104 | 104 | $collection = new \MongoDB\Collection($manager, "laravel.stats"); |
| 105 | - $tweeterinfo = collect($collection->find(['origin' => 'Twitter', 'type' => 'infos'])->toArray())->first(); |
|
| 105 | + $tweeterinfo = collect($collection->find([ 'origin' => 'Twitter', 'type' => 'infos' ])->toArray())->first(); |
|
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | $actor = new Actors(); // Je récpere mon modèle |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | 'avgnotepresse' => $avgnotepresse->avgpress, |
| 127 | 127 | 'avgacteurs' => $avgacteurs->age, |
| 128 | 128 | 'videos' => $videos, |
| 129 | - 'video' => $videos[0], |
|
| 129 | + 'video' => $videos[ 0 ], |
|
| 130 | 130 | 'youtubeinfo' => $youtubeinfo->data, |
| 131 | - 'tweeterinfo' => $tweeterinfo['data'][0], |
|
| 131 | + 'tweeterinfo' => $tweeterinfo[ 'data' ][ 0 ], |
|
| 132 | 132 | 'youtubeinfodateupdated' => $youtubeinfo->created, |
| 133 | - 'tweeterinfodateupdated' => $tweeterinfo['created_at'], |
|
| 133 | + 'tweeterinfodateupdated' => $tweeterinfo[ 'created_at' ], |
|
| 134 | 134 | 'avghour' => $avghour->avghour, |
| 135 | 135 | 'nbacteurs' => $nbacteurs, |
| 136 | 136 | 'nbcommentaires' => $nbcommentaires, |
@@ -36,13 +36,13 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function handle() |
| 38 | 38 | { |
| 39 | - $infos = \Thujohn\Twitter\Facades\Twitter::getUsersLookup(['screen_name' => 'Symfomany', 'format' => 'php']); |
|
| 39 | + $infos = \Thujohn\Twitter\Facades\Twitter::getUsersLookup([ 'screen_name' => 'Symfomany', 'format' => 'php' ]); |
|
| 40 | 40 | $manager = new \MongoDB\Driver\Manager("mongodb://localhost:27017"); |
| 41 | 41 | $collection = new \MongoDB\Collection($manager, "laravel.tweets"); |
| 42 | 42 | |
| 43 | 43 | if (!empty($infos)) { |
| 44 | 44 | |
| 45 | - $collection->deleteMany(['origin' => 'Twitter', 'type' => 'infos']); |
|
| 45 | + $collection->deleteMany([ 'origin' => 'Twitter', 'type' => 'infos' ]); |
|
| 46 | 46 | |
| 47 | 47 | $stat = [ |
| 48 | 48 | "origin" => "Twitter", |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $tweets = \Thujohn\Twitter\Facades\Twitter::getDmsOut(['format' => 'php']); |
|
| 57 | + $tweets = \Thujohn\Twitter\Facades\Twitter::getDmsOut([ 'format' => 'php' ]); |
|
| 58 | 58 | if (!empty($tweets)) { |
| 59 | - $collection->deleteMany(['origin' => 'Twitter', 'type' => 'dmsout']); |
|
| 59 | + $collection->deleteMany([ 'origin' => 'Twitter', 'type' => 'dmsout' ]); |
|
| 60 | 60 | |
| 61 | 61 | foreach ($tweets as $tweet) { |
| 62 | 62 | $stat = [ |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - $tweets = \Thujohn\Twitter\Facades\Twitter::getFavorites(['format' => 'php']); |
|
| 72 | + $tweets = \Thujohn\Twitter\Facades\Twitter::getFavorites([ 'format' => 'php' ]); |
|
| 73 | 73 | if (!empty($tweets)) { |
| 74 | - $collection->deleteMany(['origin' => 'Twitter', 'type' => 'favorites']); |
|
| 74 | + $collection->deleteMany([ 'origin' => 'Twitter', 'type' => 'favorites' ]); |
|
| 75 | 75 | |
| 76 | 76 | foreach ($tweets as $tweet) { |
| 77 | 77 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | 'format' => 'php', ]); |
| 93 | 93 | |
| 94 | 94 | if (!empty($tweets)) { |
| 95 | - $collection->deleteMany(['origin' => 'Twitter', 'type' => 'mentionstimeline']); |
|
| 95 | + $collection->deleteMany([ 'origin' => 'Twitter', 'type' => 'mentionstimeline' ]); |
|
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | foreach ($tweets as $tweet) { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | ]); |
| 115 | 115 | |
| 116 | 116 | if (!empty($tweets)) { |
| 117 | - $collection->deleteMany(['origin' => 'Twitter', 'type' => 'hometimeline']); |
|
| 117 | + $collection->deleteMany([ 'origin' => 'Twitter', 'type' => 'hometimeline' ]); |
|
| 118 | 118 | |
| 119 | 119 | foreach ($tweets as $tweet) { |
| 120 | 120 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | ]); |
| 137 | 137 | |
| 138 | 138 | if (!empty($tweets)) { |
| 139 | - $collection->deleteMany(['origin' => 'Twitter', 'type' => 'usertimeline']); |
|
| 139 | + $collection->deleteMany([ 'origin' => 'Twitter', 'type' => 'usertimeline' ]); |
|
| 140 | 140 | |
| 141 | 141 | foreach ($tweets as $tweet) { |
| 142 | 142 | |