Skip to content

Instantly share code, notes, and snippets.

@Antti
Created January 27, 2011 09:36
Show Gist options
  • Save Antti/798294 to your computer and use it in GitHub Desktop.
Save Antti/798294 to your computer and use it in GitHub Desktop.
UK Visa Status
gem 'mechanize'
require 'mechanize'
class UKVisaStatus
def initialize(reference_number,date_of_birth)
@reference_number, @date_of_birth = reference_number, date_of_birth
@agent = Mechanize.new
end
def status
page = @agent.get("https://www.vfs.org.in/Ukg-PassportTracking/ApplicantTrackStatus.aspx?Data=zB/rldwRJCtWdUiUjektSA%3d%3d")
result_page = page.form_with(:name => "form1") do |f|
f.txtDat = @date_of_birth.day
f.txtMont = @date_of_birth.month
f.txtYea = @date_of_birth.year
f.txtRefNO = @reference_number
end.click_button
result_page.search("#lblScanStatus").inner_text
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment