You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.3 KiB

  1. <?php
  2. use Illuminate\Foundation\Inspiring;
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Console Routes
  6. |--------------------------------------------------------------------------
  7. |
  8. | This file is where you may define all of your Closure based console
  9. | commands. Each Closure is bound to a command instance allowing a
  10. | simple approach to interacting with each command's IO methods.
  11. |
  12. */
  13. Artisan::command('inspire', function() {
  14. $this->comment(Inspiring::quote());
  15. })->describe('Display an inspiring quote');
  16. /*
  17. Artisan::command('score', function(){
  18. $tweet = App\Tweet::where(['id'=>27])->first();
  19. $score = $tweet->mission->score($tweet->team);
  20. event(new App\Events\ScoreUpdatedEvent($tweet->team,
  21. $tweet->mission, $score, $tweet->mission->complete($tweet->team), $tweet->team->total_score()));
  22. $this->comment("Score: $score");
  23. });
  24. */
  25. Artisan::command('get_tweet', function(){
  26. $id = '883471631200296961';
  27. $tweet = Twitter::getTweet($id);
  28. $this->comment(json_encode($tweet));
  29. });
  30. Artisan::command('add_webhook', function(){
  31. $response = Twitter::post('/account_activity/all/:env_name/webhooks.json', [
  32. 'url' => ''
  33. ]);
  34. $response = Twitter::post('/account_activity/all/prod/subscriptions.json');
  35. });