**------------------------------------------------------------------------------------------------
* @header_start
* WebGrab+Plus ini for grabbing EPG data from TvGuide websites
* @Site: tunein.com
* @MinSWversion: V0
* none
* @Revision 0 - [25/11/2012] Jan van Straaten
* none
* @Remarks:
* Spanish radio
* @header_end
**------------------------------------------------------------------------------------------------
site {url=tunein.com|timezone=UTC+00:00|maxdays=10|cultureinfo=es-ES|charset=utf-8|titlematchfactor=90|nopageoverlaps}
*
url_index{url(debug)|http://tunein.com/station/schedule/?stationId=|channel|&date=|urldate}
http://tunein.com/station/schedule/?stationId=78109&date=11/26/2012
urldate.format {datestring|MM/dd/yyyy}
*
* a rather complicated showsplit:
* some channels have no schedules on certain days
* the following adds dummy shows with "no schedules" as title on the days that have nothing in the index
* the first showsplit splits the indexpages in days:
index_showsplit.scrub {multi|
} * split in days
*
scope.range {(splitindex)|end}
index_showsplit.modify {replace||\|} split in shows and dayheaders, something like dssdssssddssdss
* index_variable_element contains the dummy show:
index_variable_element.modify {addstart| 12am - 11:59pm
">No schedules
}
index_temp_1.modify {calculate(type=element format=F0)|'index_showsplit' #} * number of elements in showsplit s + d
index_temp_2.modify {addstart|'index_showsplit'} * copy showsplit to t2
index_temp_4.modify {calculate(format=F0)}
index_showsplit.modify {clear}
loop {('index_temp_1' > "1" max=500)|end}
index_temp_1.modify {calculate(format=F0)|1 -} * loop counter
index_temp_4.modify {calculate(format=F0)|1 +} * used to know if it's the last (= first in loop)
index_temp_6.modify {substring(type=element)|'index_temp_2' 'index_temp_1' 1} * show to inspect
index_temp_3.modify {calculate(format=F0)|"0" *} *t3 holds the test condition, set to 0
index_temp_3.modify {calculate('index_temp_6' ~ "" format=F0)|1 +} *dayheader? increase with 1
*** if last is a dayheader, add a dummy
index_temp_3.modify {calculate('index_temp_4' "1" format=F0)|1 +}
index_showsplit.modify {addstart('index_temp_3' "2")|####'index_variable_element'} * add dummy
***
index_showsplit.modify {addstart('index_temp_3' "0")|####'index_temp_6'} * no dayheader, real show
index_temp_1.modify {calculate(format=F0)|1 -} * index next show
index_temp_6.modify {substring(type=element)|'index_temp_2' 'index_temp_1' 1} * next show to inspect
index_temp_3.modify {calculate('index_temp_6' ~ "" format=F0)|1 +} *dayheader? if 2 subsequent headers
index_showsplit.modify {addstart('index_temp_3' > "1")|####'index_variable_element'} * add dummy if subsequent dayheaders (day without shows)
index_temp_1.modify {calculate(format=F0)|1 +} * move index back to actual show
end_loop
index_showsplit.modify {replace|####|\|} Make multi
end_scope.range
*
scope.range {(indexshowdetails)|end}
index_start.scrub {single(separator=" - " include=first)|||
|}
index_stop.scrub {single(separator=" - " exclude=first)|||
|}
index_title.scrub {single(separator="\">" include=last)||
|
|}
end_scope.range
*
index_title.modify {cleanup}
*channel list file:
* 16 primary stations:
*url_index {url|http://tunein.com/}
*index_site_channel.scrub {multi|}
*index_site_channel.modify {cleanup(removeduplicates=equal)}
*index_site_id.modify {cleanup(removeduplicates=equal)}