# HG changeset patch # User KAMURA Sota # Date 1328624801 -32400 # Node ID 2ebeaae57e96a53e50d3c3be2d4fdbaf513a9917 # Parent ef8cc6249d5314b7c2f8b6aa4135dd8bd30a4d55 chop 140 diff -r ef8cc6249d53 -r 2ebeaae57e96 xsotter_class.rb --- a/xsotter_class.rb Tue Feb 07 21:09:09 2012 +0900 +++ b/xsotter_class.rb Tue Feb 07 23:26:41 2012 +0900 @@ -10,7 +10,7 @@ class Xsotter def initialize (token_path) - p @path = File.expand_path(token_path) + @path = File.expand_path(token_path) # @path = File.expand_path("~") + "/.xsotter_token" @login = false @kcode = "-e" diff -r ef8cc6249d53 -r 2ebeaae57e96 xsotter_mail.rb --- a/xsotter_mail.rb Tue Feb 07 21:09:09 2012 +0900 +++ b/xsotter_mail.rb Tue Feb 07 23:26:41 2012 +0900 @@ -12,30 +12,19 @@ elsif/.*@.*/ !~ sender exit 0 end - +subject="" while line = gets f=1 if /^$/=~line - if f ==1 - body += line + if f == 1 + body += line else - subject = line if /Subject/ =~ line + subject = line.split(/:/)[1] if /Subject/ =~ line end end -body = NKF.nkf('-e', body) -subject = NKF.nkf('-e', subject).split(/:/)[1] - - -count = 0 -post="" -subject += body -subject.split(//).each{|str| - post += str - break if 139 == count += 1 -} -puts post = NKF.nkf('-w', post) -com=["-T", post] - +post = subject + body +post = $& if /.{140}/me=~post +com=["-T", NKF.nkf('-e',post)] #com=["-T", "test"] xsotter=Xsotter.new("/home/irhome/c109/c109047/xsotter/c109047_token") xsotter.comand(com)