Changeset 7088 for platform/tdiary/util
- Timestamp:
- 02/24/08 12:08:32 (9 months ago)
- Files:
-
- 1 modified
-
platform/tdiary/util/posttdiary/posttdiary.rb (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/tdiary/util/posttdiary/posttdiary.rb
r7080 r7088 68 68 use_subject = false 69 69 parser.set_options( 70 ['--image-path', '-i', GetoptLong::REQUIRED_ARGUMENT],71 ['--image-url', '-u', GetoptLong::REQUIRED_ARGUMENT],70 ['--image-path', '-i', GetoptLong::REQUIRED_ARGUMENT], 71 ['--image-url', '-u', GetoptLong::REQUIRED_ARGUMENT], 72 72 ['--image-format', '-f', GetoptLong::REQUIRED_ARGUMENT], 73 ['--use-subject', '-s', GetoptLong::NO_ARGUMENT]73 ['--use-subject', '-s', GetoptLong::NO_ARGUMENT] 74 74 ) 75 75 begin … … 93 93 image_url.sub!( %r[/*$], '/' ) if image_url 94 94 url = ARGV.shift 95 if %r|http://([^:/] *):?(\d*)(/.*)| =~ url then95 if %r|http://([^:/]+)(?::(\d+))?(/.*)| =~ url then 96 96 host = $1 97 port = $2.to_i 98 cgi = $3 99 raise 'bad url.' if not host or not cgi 100 port = 80 if port == 0 97 port = ($2 || 80).to_i 98 cgi = $3 101 99 else 102 100 raise 'bad url.' … … 134 132 name=".+(\.[^.]+?)" (?# 1: extension) 135 133 ]imx 136 image_ext = $1.downcase137 now = Time::now138 list = image_list( now.strftime( "%Y%m%d" ), image_dir )134 image_ext = $1.downcase 135 now = Time::now 136 list = image_list( now.strftime( "%Y%m%d" ), image_dir ) 139 137 image_name = now.strftime( "%Y%m%d" ) + "_" + list.length.to_s + image_ext 140 138 File::umask( 022 ) … … 176 174 if /^To:(.*)$/ =~ head then 177 175 addr = case to = $1.strip 178 when /.*?\s*<(.+)>/ 179 when /(.+?)\s*\(.*\)/ 176 when /.*?\s*<(.+)>/, /(.+?)\s*\(.*\)/ 180 177 $1 181 178 else … … 227 224 res, = http.get( cgi, { 228 225 'Authorization' => "Basic #{auth}", 229 'Referer' => url })226 'Referer' => url }) 230 227 if %r|<input type="hidden" name="csrf_protection_key" value="([^"]+)">| =~ res.body then 231 228 data << "&csrf_protection_key=#{CGI::escape( CGI::unescapeHTML( $1 ) )}" … … 233 230 res, = http.post( cgi, data, { 234 231 'Authorization' => "Basic #{auth}", 235 'Referer' => url })232 'Referer' => url }) 236 233 end 237 234
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)