Class: Vakit::Connect

Inherits:
Object
  • Object
show all
Defined in:
lib/vakit/connect.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opt = {}) ⇒ Connect

Returns a new instance of Connect.



3
4
5
# File 'lib/vakit/connect.rb', line 3

def initialize(opt={})
	@path = opt[:path]
end

Class Method Details

.shaberObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/vakit/connect.rb', line 7

def self.shaber
	@doc ||= Nokogiri::HTML(open('http://www.samanyoluhaber.com/')) 
	x = @doc.css('#hnmzT')

	times = []
	x.each do |vakit|
		data = vakit.children.first.children.last.content
		data_add = data.slice(0..data.length-1)
		times.push(data_add)
	end
	vakit = {

		imsak: times[0],
		sabah: times[1],
		oglen: times[2],
		ikindi: times[3],
		aksam: times[4],
		yatsi: times[5]


	}

end