Changeset 17103 for lang/vim

Show
Ignore:
Timestamp:
08/05/08 17:42:12 (4 months ago)
Author:
ujihisa
Message:

refactoring

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/vim/ruby/mixi.vim

    r17102 r17103  
    9999    10.downto(1) do |i| 
    100100      buf = '' 
    101       buf << (page/("div#echo_nickname_" + i.to_s)).first.to_plain_text.toutf8 
     101      buf << (page/("div#echo_nickname_#{i}")).first.to_plain_text.toutf8 
    102102      buf << ":" 
    103       buf << (page/("div#echo_body_" + i.to_s)).first.to_plain_text.toutf8 
     103      buf << (page/("div#echo_body_#{i}")).first.to_plain_text.toutf8 
    104104      line.push buf 
    105105    end 
     
    140140  # line2: input your password 
    141141  # line3: input "premium" if you are premium 
    142     if File.exist?(File.expand_path('~/.mixi')) 
    143       mixi_config = File.read(File.expand_path('~/.mixi')) 
    144       email, password, premium = mixi_config.split(/\r?\n/) 
    145       Mixi.new email, password, (premium == 'premium') 
    146     else 
    147       m = Mixi.new 'YOUR_EMAIL', 'YOUR_PASSWORD' 
    148     end 
     142  if File.exist?(File.expand_path('~/.mixi')) 
     143    mixi_config = File.read(File.expand_path('~/.mixi')) 
     144    email, password, premium = mixi_config.split(/\r?\n/) 
     145    Mixi.new email, password, (premium == 'premium') 
     146  else 
     147    m = Mixi.new 'YOUR_EMAIL', 'YOUR_PASSWORD' 
     148  end 
    149149  # if you are mixi premium member: 
    150150  # m = Mixi.new 'YOUR_EMAIL', 'YOUR_PASSWORD', true 
     
    162162  body = body[0..-(images.length + 1)].join "\n" 
    163163 
    164   m = create_mixi_instance; 
     164  m = create_mixi_instance 
    165165 
    166166  m.post title.toeuc, body.toeuc, images 
     
    177177  message = VIM.evaluate %[getline('.')] 
    178178 
    179   m = create_mixi_instance; 
     179  m = create_mixi_instance 
    180180 
    181181  fork { 
     
    191191  message = VIM.evaluate %[getline(1)] 
    192192 
    193   m = create_mixi_instance; 
     193  m = create_mixi_instance 
    194194 
    195195  m.post_echo message.toeuc