Class: Markify::Scraper::Hbrs
Overview
Copyright Daniel Meißner <[email protected]>, 2013
This file is part of Markify.
Markify is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Markify is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Markify. If not, see <www.gnu.org/licenses/>.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(login_name, login_password) ⇒ Hbrs
constructor
A new instance of Hbrs.
- #test_login ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(login_name, login_password) ⇒ Hbrs
Returns a new instance of Hbrs.
23 24 25 26 27 28 |
# File 'lib/markify/scraper/hbrs.rb', line 23 def initialize(login_name, login_password) super(login_name, login_password, 'https://dias.fh-bonn-rhein-sieg.de/d3/SISEgo.asp?UserAcc=Gast&DokID=DiasSWeb&ADias2Dction=Login' ) end |
Instance Method Details
#test_login ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/markify/scraper/hbrs.rb', line 30 def test_login login_page = @agent.get(@data[:login_page]) error_page = sis_login(@data[:login_name], @data[:login_password], login_page) if error_page.search(".//*[@id='inhalt']/table/tbody/tr/td/form/center/table/tr[3]/td").text =~ /Benutzername unbekannt oder falsches Kennwort eingegeben!/ puts "Scraper: Username and password wrong." else puts "Scraper: Login works." end end |