Tweeter is a Crystal interface to the Twitter API and is heavily based off the wonderfully thurough Twitter Ruby Gem by sferik.
Add this to your application's shard.yml
:
dependencies:
tweeter:
github: watzon/tweeter
Make sure to include the tweeter gem at the root of your application or wherever you need to access it's functionality.
require "tweeter"
Configuration for Tweeter is very similar to that of the Twitter Ruby Gem. The Twitter API requires authentication via OAuth, so you'll first need to register your application with Twitter to receive a consumer_key and consumer_secret. You can also authenticate your current user to get an access_token and access_token_secret. Make sure you set the correct access level.
You can pass the values you receive as a block to Tweeter::REST::Client.new
.
client = Tweeter::REST::Client.new do |config|
config.consumer_key = "YOUR_CONSUMER_KEY"
config.consumer_secret = "YOUR_CONSUMER_SECRET"
config.access_token = "YOUR_ACCESS_TOKEN"
config.access_token_secret = "YOUR_ACCESS_SECRET"
end
The project is still in development and until it has a stable API I will refrain from listing usage examples here. Feel free to look in the specs
directory to see how things are done in the tests that have been written so far.
- Authentication
- Cursor Support
- Streaming Client
- REST Client
- Direct Messages (sending not working yet)
- Favorites
- Friends and Followers
- Help
- Lists
- OAuth
- Places and Geo
- Saved Searches
- Search
- Spam Reporting
- Suggested Users
- Timelines
- Trends
- Tweets
- Undocumented Endpoints
- Users
- Complete Specs
Please make sure you have the latest version of Crystal installed before doing any development. As of now this shard is updated to work with Crystal 0.24.1
. Please also run crystal tool format
& crystal spec
before commiting.
- Fork it ( https://github.com/watzon/tweeter/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- watzon Chris Watson - creator, maintainer