Class: VisaCheck::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/visa_check/reader.rb

Overview

VisaCheck::Reader retrieves an online PDF from the consulate and extracts visa application numbers.

Constant Summary collapse

HOST =
'm.germania.diplo.de'
PAGE =
'http://m.germania.diplo.de/Vertretung/russland/de/02-mosk/1-visa/3-nationale-visa/0-nationale-visa.html?r'
SOURCE =
'http://m.germania.diplo.de/contentblob/4048654/Daten/4377008/1entschiedenevisumantraege.pdf'
USER_AGENT =
'Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0'

Class Method Summary collapse

Class Method Details

.applicationsObject

Fetch a list of application numbers contained in the published document



17
18
19
# File 'lib/visa_check/reader.rb', line 17

def self.applications
  pdf_reader.pages.map { |page| page.text.scan /^(\d{7})\s+/ }.flatten
end