Show
Ignore:
Timestamp:
08/15/08 09:50:02 (5 months ago)
Author:
hsbt
Message:

oops.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • platform/tdiary/plugin/notify_wassr.rb

    r17657 r17659  
    66 
    77require 'net/http' 
     8require 'rubygems' 
     9require 'json/ext' 
    810 
    911module Wassr 
    10         URL = 'twitter.com' 
     12        URL = 'wassr.jp' 
    1113        PATH = '/statuses/update.json' 
    1214        SOURCE = 'notify_wassr.rb' 
     
    2527                        req.body = 'status=' + URI.encode(status, /[^-.!~*'()\w]/n) + '&source=' + SOURCE 
    2628 
    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 
    3036                end 
    3137        end 
     
    5157 
    5258        begin 
    53                 wsupdater = Wassr.new(@conf['wassr.user'], @conf['wassr.pass'] ) 
     59                wsupdater = Wassr::Updater.new(@conf['wassr.user'], @conf['wassr.pass'] ) 
    5460                wsupdater.update( status ) 
    5561        rescue => e