Class: TestGrabTvsou

Inherits:
Object
  • Object
show all
Includes:
Grabepg
Defined in:
lib/test/test_grab_tvsou.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTestGrabTvsou

Returns a new instance of TestGrabTvsou.



9
10
11
# File 'lib/test/test_grab_tvsou.rb', line 9

def initialize
  @grabtvsou = GrabTvsou.new("mobile",[])
end

Class Method Details

.startObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/test/test_grab_tvsou.rb', line 43

def self.start
  _grabtvsou = GrabTvsou.new("mobile",[])
  p channels = _grabtvsou.dispose_home_page
  i = 0
  ret = {}
    channels.each do |channel_name,channel_msg|
      return ret if i==2
      _grabtvsou.dispose_schedule_page(channel_msg[:url],0,1).each do |key,value|
         data = key
         value.each do |schedule|
           url = schedule[:url]
           p _grabtvsou.dispose_show_info(url)
         end
      end
      i += 1
    end
end

Instance Method Details

#dispose_home_pageObject



34
35
36
# File 'lib/test/test_grab_tvsou.rb', line 34

def dispose_home_page
  @grabtvsou.dispose_home_page
end

#dispose_href_schedule_data(href, start_time, use_time) ⇒ Object



17
18
19
# File 'lib/test/test_grab_tvsou.rb', line 17

def dispose_href_schedule_data(href,start_time,use_time)
  @grabtvsou.dispose_href_schedule_data(href,start_time,use_time)
end

#dispose_schedule_page(href = "http://m.tvsou.com/epg.asp?TVid=1&Channelid=1&pro=ys") ⇒ Object



21
22
23
# File 'lib/test/test_grab_tvsou.rb', line 21

def dispose_schedule_page(href="http://m.tvsou.com/epg.asp?TVid=1&Channelid=1&pro=ys")
 @grabtvsou.dispose_schedule_page(href,0,1)
end

#dispose_show_infoObject



25
26
27
28
29
30
31
32
# File 'lib/test/test_grab_tvsou.rb', line 25

def dispose_show_info
  hrefs = ["http://msou.com//jq3.asp?id=75928&tid=3","http://m.tvsou.com//jq3.asp?id=89450&tid=3"]
  ret = []
  hrefs.each do |href|
    ret<<@grabtvsou.dispose_show_info(href)
  end
  ret
end

#get_channel_logo(url = "epg.asp?TVid=1&Channelid=1&pro=ys") ⇒ Object



38
39
40
# File 'lib/test/test_grab_tvsou.rb', line 38

def (url="epg.asp?TVid=1&Channelid=1&pro=ys")
  @grabtvsou.(url)
end

#get_data(start_time, use_time) ⇒ Object



13
14
15
# File 'lib/test/test_grab_tvsou.rb', line 13

def get_data(start_time,use_time)
  @grabtvsou.get_data(start_time,use_time)
end