Header

  1. View current page

    ikspres님의 노트

Profile_img_60x60_01
6

스프링노트 API 라이브러리

Rspringnote

 

(만약, 당신이 좀 더 멋진 사람이 되고 싶다면, 이 라이브러리 대신 REST API를 사용한 SpringnoteResource 를 사용하시기를 권합니다.

이 Rspringnote 는 SpirngnoteResource 에 비해서 좀 더 가볍고 간단한 방식의 구현이라고 할 수 있습니다.)

 

다운받기

  1. svn checkout http://rspringnote.googlecode.com/svn/trunk/ rspringnote

 

사용법

  1. #

  2. #

  3. #== Set personal access information of account and application.

  4. #== CAUTION! Before calling this, all the following functions will fail

  5. #

  6. #  Rspringnote::set_credential( 'your_open_id.xxx.com',

  7. #                             'your user key',

  8. #                             'your app id',

  9. #                             'your app key')

  10. #

  11. #== Get page of which page_id is 1234

  12. #

  13. #  page = Rspringnote::Page.new :identifier => '1234'

  14. #  page.get

  15. #

  16. #== Update page body

  17. #

  18. #  page = Rspringnote::Page.new :identifier => '1234'

  19. #  page.get

  20. #  page.source = 'new body content'

  21. #  page.put

  22. #

  23. #== Create a new page

  24. #  page = Rspringnote::Page.new(:title => 'new page title',

  25. #                              :source = 'new page body')

  26. #

  27. #  page.identifier    # ==> nil

  28. #  page.create

  29. #  page.identifier    # ==> 1235  or the id of the new page

  30. #

  31. #== Delete a new page

  32. #

  33. #  page = Rspringnote::Page.new :identifier => '1234'

  34. #  page.delete

  35. #

  36. #== Search pages

  37. #  pages = Rspringnote::Page.search('hello')  # search 'hello', full text search is off

  38. #  pages = Rspringnote::Page.search('hello', true)  # search 'hello', full text search  is on

  39. #

  40. #  pages[0].identifer

  41. #  pages[0].title

  42. #

  43. #  pages[0].source      # NOTICE!! When source is accessed, pages[0].get is called automatically

  44. #                                  because Page.search() return only identifiers and titles

  45. #

  46. #

 

 

History

Last edited on 08/04/2007 21:44 by ikspres

Comments (0)

You must log in to leave a comment. Please sign in.