Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/mruby-oauth
refactored oauth of iij/mruby using mruby-uv and mruby-http
https://github.com/matsumotory/mruby-oauth
Last synced: about 2 months ago
JSON representation
refactored oauth of iij/mruby using mruby-uv and mruby-http
- Host: GitHub
- URL: https://github.com/matsumotory/mruby-oauth
- Owner: matsumotory
- Created: 2012-12-31T07:23:32.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-12-09T14:33:38.000Z (about 11 years ago)
- Last Synced: 2024-10-18T18:23:24.144Z (3 months ago)
- Language: Ruby
- Size: 188 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mruby-oauth
oauth Class for mrubyrefactored oauth of iij/mruby.
depend on mruby-http, mruby-httprequest, mruby-digest, mruby-pack, mruby-sleep, mruby-json
## install by mrbgems
- add conf.gem line to `build_config.rb`
```ruby
MRuby::Build.new do |conf|# ... (snip) ...
conf.gem :git => 'https://github.com/matsumoto-r/mruby-oauth.git'
end
```## example
```ruby
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
ACCESS_TOKEN_SECRET = ''
API_URL = 'http://api.twitter.com/1.1/statuses/update.json'tweet = "hello twitter world from mruby-oauht"
ex_headers = {'Content-Type' => 'application/x-www-form-urlencoded'}
twitter = OAuth.new(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
response = twitter.post(API_URL, {:status => tweet}, ex_headers)if response.code.to_i == 200
puts "tweet success: #{tweet}"
else
puts "tweet failed: #{tweet}: bellow response"
p response
end
```## License
This software is licensed under the same license terms of the original mruby.