Class: TestGrabTvsou
- Inherits:
-
Object
- Object
- TestGrabTvsou
- Includes:
- Grabepg
- Defined in:
- lib/test/test_grab_tvsou.rb
Class Method Summary collapse
Instance Method Summary collapse
- #dispose_home_page ⇒ Object
- #dispose_href_schedule_data(href, start_time, use_time) ⇒ Object
- #dispose_schedule_page(href = "http://m.tvsou.com/epg.asp?TVid=1&Channelid=1&pro=ys") ⇒ Object
- #dispose_show_info ⇒ Object
- #get_channel_logo(url = "epg.asp?TVid=1&Channelid=1&pro=ys") ⇒ Object
- #get_data(start_time, use_time) ⇒ Object
-
#initialize ⇒ TestGrabTvsou
constructor
A new instance of TestGrabTvsou.
Constructor Details
#initialize ⇒ TestGrabTvsou
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
.start ⇒ Object
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_page ⇒ Object
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_info ⇒ Object
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 get_channel_logo(url="epg.asp?TVid=1&Channelid=1&pro=ys") @grabtvsou.get_channel_logo(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 |