You are here

function twitter_drush_command in Twitter 7.6

Same name and namespace in other branches
  1. 6.5 twitter.drush.inc \twitter_drush_command()
  2. 7.3 twitter.drush.inc \twitter_drush_command()
  3. 7.4 twitter.drush.inc \twitter_drush_command()
  4. 7.5 twitter.drush.inc \twitter_drush_command()

Implements COMMANDFILE_drush_command()

File

./twitter.drush.inc, line 10
Drush commands for the Twitter module.

Code

function twitter_drush_command() {
  $items = array();
  $items['twitter-search'] = array(
    'description' => 'Searches the Twitter API for something.',
    'arguments' => array(
      'keyword' => 'The keyword you are searching for. Add @ for usernames and # for hashtags.',
    ),
    'required-arguments' => TRUE,
    'options' => array(
      'limit' => 'Limit the number of results to be printed.',
      'randomize' => 'Randomize the result.',
    ),
    'examples' => array(
      'drush twitter-search \'#drupal\'' => 'Pull tweets containing the hashtag #drupal.',
      'drush twitter-search \'#drupalconmunich\' --limit=1 --randomize' => 'Picks a random tweet containing \'#drupalconmunich\'.',
    ),
    'aliases' => array(
      'tws',
    ),
    'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_SITE,
  );
  $items['twitter-tweet'] = array(
    'aliases' => array(
      'tweet',
    ),
    'callback' => 'twitter_drush_tweet',
    'drupal dependencies' => array(
      'twitter',
    ),
    'description' => 'Tweets from command line, using one of the authenticated global accounts or accounts owned by a specific user.',
    'arguments' => array(
      'tweet' => 'Text of the tweet.',
      'screen_name' => 'Screen name of the account to post from.',
    ),
    'examples' => array(
      'drush tweet \'It works!\'' => 'Post a short test tweet. You will be prompted to choose among authenticated accounts.',
      'drush tweet \'Now what?\' JohnDoe' => 'Post another short tweet on behalf of \'JohnDoe\'.',
      'drush tweet --user=42 \'Now what?\' JohnDoe' => 'Post another short tweet on behalf of \'JohnDoe\', which is owned by user 42.',
    ),
    'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
  );
  return $items;
}