由於很多OM都是利用eqsl來記錄log,有時候累積下來很多,點掉log又很累....我是懶人....
寫了一個自動點掉log的小AP大家可自行使用
require 'rubygems'
require 'watir-classic'
#require 'watir-webdriver'
class Click_Eqsl
def qso(utc)
browser = Watir::IE.attach(:url, /ConfirmQSO.cfm/)
browser.text_field(:index,0).set(utc)
browser.text_field(:index,2).set('TNK QSO, 73 DE BX2ADE')
browser.button(:index,0).click
sleep(1)
browser.close
end
def swl(utc)
browser = Watir::IE.attach(:url, /ConfirmQSO.cfm/)
browser.text_field(:index,0).set(utc)
browser.text_field(:index,2).set('CFM , 73 DE BX2ADE')
browser.button(:index,0).click
sleep(1)
browser.close
end
end
b=Watir::Browser.new()
b.goto 'http://eqsl.cc'
#login
b.text_field(:name,'Callsign').set('yourcallsign')
b.text_field(:name,'EnteredPassword').set('yourpasswrrd')
b.button(:name,'Login').click
sleep(5)
b.link(:text,'InBox').click
sleep(5)
b.link(:href,"http://eqsl.cc/qslcard/Inbox.cfm?Archive=0&Reject=0").click
#goto logbook
sleep(3)
b.table(:index,6).rows.each_with_index do |row,index|
if (index > 1)
#puts row.cell(:index,2).text
if ( !row.cell(:index,8).text.downcase.index('wkd'))
#qso
#puts row.cell(:index,2).text
if (row.cells.length > 10)
row.cell(:index,11).link.click
utc =row.cell(:index,3).text[11..-1]
sleep(2)
Click_Eqsl.new.qso(utc)
sleep(1)
end
else
if (row.cells.length > 10)
row.cell(:index,11).link.click
utc =row.cell(:index,3).text[11..-1]
sleep(2)
Click_Eqsl.new.swl(utc)
sleep(1)
end
end
end
end
b.close
|