스프링노트 API 라이브러리
Rspringnote
(만약, 당신이 좀 더 멋진 사람이 되고 싶다면, 이 라이브러리 대신 REST API를 사용한 SpringnoteResource 를 사용하시기를 권합니다.
이 Rspringnote 는 SpirngnoteResource 에 비해서 좀 더 가볍고 간단한 방식의 구현이라고 할 수 있습니다.)
다운받기
-
svn checkout http://rspringnote.googlecode.com/svn/trunk/ rspringnote
사용법
-
#
-
#
-
#== Set personal access information of account and application.
-
#== CAUTION! Before calling this, all the following functions will fail
-
#
-
# Rspringnote::set_credential( 'your_open_id.xxx.com',
-
# 'your user key',
-
# 'your app id',
-
# 'your app key')
-
#
-
#== Get page of which page_id is 1234
-
#
-
# page = Rspringnote::Page.new :identifier => '1234'
-
# page.get
-
#
-
#== Update page body
-
#
-
# page = Rspringnote::Page.new :identifier => '1234'
-
# page.get
-
# page.source = 'new body content'
-
# page.put
-
#
-
#== Create a new page
-
# page = Rspringnote::Page.new(:title => 'new page title',
-
# :source = 'new page body')
-
#
-
# page.identifier # ==> nil
-
# page.create
-
# page.identifier # ==> 1235 or the id of the new page
-
#
-
#== Delete a new page
-
#
-
# page = Rspringnote::Page.new :identifier => '1234'
-
# page.delete
-
#
-
#== Search pages
-
# pages = Rspringnote::Page.search('hello') # search 'hello', full text search is off
-
# pages = Rspringnote::Page.search('hello', true) # search 'hello', full text search is on
-
#
-
# pages[0].identifer
-
# pages[0].title
-
#
-
# pages[0].source # NOTICE!! When source is accessed, pages[0].get is called automatically
-
# because Page.search() return only identifiers and titles
-
#
-
#
History
Last edited on 08/04/2007 21:44 by ikspres
Comments (0)