Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby wrapper for the Qiita API v1

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec Fix typo
Octocat-spinner-32 .gitignore Execute `bundle gem qiita`
Octocat-spinner-32 .rspec Setup rspec
Octocat-spinner-32 Gemfile Execute `bundle gem qiita`
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.md Write README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 qiita.gemspec Add rspec for test
README.md

Qiita

Ruby wrapper for Qiita API v1.

Installation

Add this line to your application's Gemfile:

gem 'qiita'

And then execute:

$ bundle

Or install it yourself as:

$ gem install qiita

Usage

Get user's items

Qiita.user_items 'yaotti'

Get tag's items

Qiita.tag_items 'ruby'

Get a specified item with comments and raw markdown content

item_uuid = '1234567890abcdefg'
Qiita.item item_uuid

Authenticated requests

Login with "username & password" or "token"

qiita = Qiita.new url_name: 'yaotti', password: 'mysecret' # => contains token
# or
qiita = Qiita.new token: 'myauthtoken'

Get my items

qiita.user_items

Post/Update/Delete an item

# post
item = qiita.post_item title: 'Hello', body: 'markdown text', tags: [{ name: 'ruby', versions: %w[1.9.2 1.9.3] }], private: false

# update
qiita.update_item item.uuid, title: 'modified'

# delete
qiita.delete_item item.uuid

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.