Changeset 17659 for platform/tdiary/plugin
- Timestamp:
- 08/15/08 09:50:02 (3 months ago)
- Files:
-
- 1 modified
-
platform/tdiary/plugin/notify_wassr.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/tdiary/plugin/notify_wassr.rb
r17657 r17659 6 6 7 7 require 'net/http' 8 require 'rubygems' 9 require 'json/ext' 8 10 9 11 module Wassr 10 URL = ' twitter.com'12 URL = 'wassr.jp' 11 13 PATH = '/statuses/update.json' 12 14 SOURCE = 'notify_wassr.rb' … … 25 27 req.body = 'status=' + URI.encode(status, /[^-.!~*'()\w]/n) + '&source=' + SOURCE 26 28 27 Net::HTTP.start(URL, 80) {|http| 28 res = http.request(req) 29 } 29 Net::HTTP.start( URL, 80 ) do |http| 30 response = http.request(req) 31 json = JSON.parse(response.body) 32 if json.has_key? 'error' 33 raise 'update failed.' 34 end 35 end 30 36 end 31 37 end … … 51 57 52 58 begin 53 wsupdater = Wassr .new(@conf['wassr.user'], @conf['wassr.pass'] )59 wsupdater = Wassr::Updater.new(@conf['wassr.user'], @conf['wassr.pass'] ) 54 60 wsupdater.update( status ) 55 61 rescue => e
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)