Created
October 12, 2012 05:33
-
-
Save fukajun/3877493 to your computer and use it in GitHub Desktop.
qiita gemを使ってみたメモ ref: http://qiita.com/items/d2893476d39b4d120c57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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