• Stars
    star
    150
  • Rank 247,323 (Top 5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created about 12 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Qiita API v2 client library and CLI tool, written in Ruby

Qiita

Gem Version Build Status

Qiita API v2 client library and CLI tool, written in Ruby.

Install

Note: requires Ruby 2.0.0 or higher.

gem install qiita

Library

require "qiita"

client = Qiita::Client.new(access_token: "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd")
client.list_items
client.list_users
client.list_user_items("r7kamura")
client.get_user("r7kamura")
client.get_user("r7kamura").status
client.get_user("r7kamura").headers
client.get_user("r7kamura").body

CLI

qiita executable calls Qiita::Client's methods.

$ qiita <method> <arguments> [headers|params] [options]
           |          |          |      |         |
           |          |          |      |         `-- -H, --host
           |          |          |      |             -a, --access-token
           |          |          |      |             -c, --color
           |          |          |      |             -h, --help
           |          |          |      |                 --header
           |          |          |      |                 --no-body
           |          |          |      |                 --no-ssl-verification
           |          |          |      |             -t, --team
           |          |          |      |
           |          |          |      `------------ key=value or key:=value
           |          |          |
           |          |          `------------------- Key:value
           |          |
           |          `------------------------------ required arguments for the method
           |
           `----------------------------------------- method name

$ qiita list_users
$ qiita get_user r7kamura
$ qiita list_user_items r7kamura

Method and Arguments

Pass Qiita::Client method name and required arguments.

Access token

Accepts access token via -a, --access-token or QIITA_ACCESS_TOKEN environment variable.

Headers

To set custom request headers, use Key:value syntax.

$ qiita list_items "Authorization:Bearer 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd"

Params

Params are used for query string in GET method, or for request body in other methods. You can set params by key=value or key:=value syntax. key=value is parsed into String value, while key:=value is parsed into JSON value (e.g. key:=17 will be {"key":17}). qiita also accepts params via STDIN.

$ qiita list_items page=2 per_page=10
$ qiita create_item < params.json

More Repositories

1

qiita-markdown

Qiita-specified markdown processor.
Ruby
383
star
2

kobito-oss

Markdown Processor built on Electron based on kobito-for-windows
CoffeeScript
202
star
3

qiita-discussions

Discussion of opinions and requests for qiita.com
74
star
4

qiita-js

Qiita API v2 client for browser and node
JavaScript
49
star
5

simplecov-parallel

Parallelism support for SimpleCov, currently only for CircleCI 1.0
Ruby
32
star
6

qiita-coat

The UI components for Qiita.
CSS
30
star
7

vscode-qiita

Qiita theme for VSCode
29
star
8

react_phoenix

Phoenix Template Engine for React (WIP)
Elixir
26
star
9

es-query-builder

A query builder for Elasticsearch in Ruby.
Ruby
26
star
10

js_rails_routes

Generate a ES6 module that contains Rails routes
Ruby
21
star
11

tasklist.js

Converts tasklist in Markdown.
JavaScript
20
star
12

Qiita-Team-Templates

Shared templates for teams
12
star
13

brwy_rails

Browserify | Watchify on Rails
Ruby
11
star
14

graphql-kaminari_connection

Kaminari based GraphQL pagination
Ruby
11
star
15

circleci-coverage_reporter

Ruby
7
star
16

qiita-popular-items-for-alexa

Generating Qiita Popular Items Feed for Alexa Flash Briefing Skill
JavaScript
7
star
17

dotfiles-for-designers

Our sweeeeet dotfiles
Shell
6
star
18

stylelint-config-qiita

Qiita config for stylelint
CSS
6
star
19

active_interactor

Simple use case interactor for Rails apps based on ActiveModel.
Ruby
5
star
20

atom-qiita-ui

Qiita UI for Atom
CSS
5
star
21

circleci-parallel

Ruby APIs for syncing CircleCI 1.0's parallel nodes and transferring files between the nodes
Ruby
5
star
22

slacken

Translate HTML sources to markup texts for Slack
Ruby
3
star
23

graphql-client-js

A lightweight GraphQL client
TypeScript
3
star
24

qiita-team-services

[DEPRECATED] Official Qiita:Team Services Integration
Ruby
3
star
25

qiita-slide-mode

Includes all the components used in Qiita's Slide Mode.
JavaScript
2
star
26

json_schema_view

View framework that brings Schema-driven Development to Rails view
Ruby
2
star
27

atom-qiita-syntax

Qiita theme syntax for Atom
CSS
2
star
28

increments-schedule

Everything about Increments' schedule
Ruby
1
star
29

isucon5q

Ruby
1
star