Add the following code to your project's shard.yml under:
dependencies
to use in production
- OR -
development_dependencies
to use in development
The EasyOAuth shard builds and verifies OAuth headers for use with third party libraries such as Halite. This library is a port of laserlemon/simple_oauth.
Add this to your application's shard.yml
:
dependencies:
easy_oauth:
github: watzon/easy_oauth
require "halite" # or whatever you want
require "easy_oauth"
options = {
"consumer_key" => "8karQBlMg6gFOwcf8kcoYw",
"consumer_secret" => "3d0vcHyUiiqADpWxolW8nlDIpSWMlyK7YNgc5Qna2M",
"token" => "201425800-Sv4sTcgoffmHGkTCue0JnURT8vrm4DiFAkeFNDkh",
"token_secret" => "T5qa1tF57tfDzKmpM89DHsNuhgOY4NT6DlNLsTFcuQ"
}
url = https://api.twitter.com/1/statuses/update.json
params = {"status" => "hi, again"}
header = EasyOAuth::Header.new(:post, url, params, options)
response = halite.auth(header).post(url, params: params)
crystal spec
and make sure you didn't break anything