Skip to content

Instantly share code, notes, and snippets.

@fukajun
Created October 12, 2012 05:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fukajun/3877493 to your computer and use it in GitHub Desktop.
Save fukajun/3877493 to your computer and use it in GitHub Desktop.
qiita gemを使ってみたメモ ref: http://qiita.com/items/d2893476d39b4d120c57
# coding: utf-8
require 'rubygems'
require 'qiita'
# use name and password
qiita = Qiita.new( url_name: 'username', password: 'password')
# Get token
p token = qiita.token
# use token
qiita = Qiita.new token: qiita.token
# Get userinfo
p u = qiita.user(qiita.url_name)
u.url_name
u.description
qiita.user_items.each do |item|
p item.uuid
article = qiita.item item.uuid
p "Titleがとれます -----------------"
p "title: #{article.title}"
p "markdownがとれます-----------------"
p "title: #{article.raw_body}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment