A very basic command line twitter client, written in PHP
- Goals & Accomplishments
- Use proven libraries like the Symfony Console Component and ZendService\Twitter
- Be faster than ttytter (which takes ages for a refresh command)
- Have a structured, extensible codebase
- Getting started
- php 5.3
Use this command to install Ornithology on your system:
git clone https://github.com/turanct/ornithology.git /usr/local/ornithology && cd /usr/local/ornithology && curl -sS https://getcomposer.org/installer | php && php composer.phar install && ln -s /usr/local/ornithology/ornithology.php /usr/local/bin/ornithology && cd -
create a directory for ornithology configs
mkdir ~/.ornithology
- Go to https://dev.twitter.com and login with your twitter username and password
- Click your avatar and navigate to My Applications
- Create a new application profile for Ornithology (leave the Callback URL field empty).
- Navigate to the API Keys menu in your app's profile, and generate a new API key. The app needs Read, Write & Direct Message permissions. You'll need this API key and API secret in the next step.
- Create a file called
Consumer.php
in your~/.ornithology
directory, and put the following content in there:
<?php
return array(
'consumerKey' => 'YOUR-API-KEY-HERE',
'consumerSecret' => 'YOUR-API-SECRET-HERE',
);
Don't forget the placeholders in that piece of code by your actual key and secret.
In your terminal:
ornithology
You should now see something like "Welcome to the Ornithology shell", and the shell line, something like this: Ornithology >
The last thing we need to do before we can use the application, is allow the application access to our twitter profile. Type this: authorize
. Your browser will open and you'll be redirected to a Twitter page asking you to authorize this application. Type the pin-code that Twitter gives you into the application, and you're all set.
In your terminal:
ornithology
- You can then start typing commands, for example
refresh
to get a list of unread tweets, ortweet
to compose a new tweet. - For a complete list of commands, type
list
orhelp
. - To quit the application, type
quit
.
Gunpowder is licensed under the MIT License