forked from turanct/ornithology
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ornithology.php
executable file
·35 lines (26 loc) · 1.28 KB
/
ornithology.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/php
<?php
// Require composer autoloader
require_once __DIR__ . '/vendor/autoload.php';
use Symfony\Component\Console as Console;
// Create twitter service
$dataStore = new Ornithology\Service\DataStoreFile(getenv('HOME') . '/.ornithology');
$twitterService = new Ornithology\Service\Twitter($dataStore);
// Initialize the application
$application = new Console\Application('Ornithology', '0.0.3');
// Add application related commands
$application->add(new Ornithology\Command\Quit('exit'));
$application->add(new Ornithology\Command\Mark('mark'));
// Add twitter related commands
$application->add(new Ornithology\Command\Authorize('authorize', $twitterService));
$application->add(new Ornithology\Command\Refresh('refresh', $twitterService));
$application->add(new Ornithology\Command\Tweet('tweet', $twitterService));
$application->add(new Ornithology\Command\Reply('reply', $twitterService));
$application->add(new Ornithology\Command\Retweet('retweet', $twitterService));
$application->add(new Ornithology\Command\Favorite('favorite', $twitterService));
$application->add(new Ornithology\Command\Urls('urls', $twitterService));
// Set some defaults
$application->setDefaultCommand('mark');
// Run the application as a shell
$shell = new Console\Shell($application);
$shell->run();