Beispiel #1
0
func (day *timeURL) parseBroadcastURLsReader(read io.Reader, cr0 *r.CountingReader) (ret []*broadcastURL, err error) {
	cr := r.NewCountingReader(read)
	root, err := html.Parse(cr)
	r.ReportLoad("🐠", cr0, cr, day.Source)
	if nil != err {
		return
	}
	return day.parseBroadcastURLsNode(root)
}
Beispiel #2
0
func (bcu *broadcastURL) parseBroadcastReader(read io.Reader, cr0 *r.CountingReader) (bc []r.Broadcast, err error) {
	cr := r.NewCountingReader(read)
	root, err := html.Parse(cr)
	r.ReportLoad("⚓️", cr0, cr, bcu.Source)
	if nil != err {
		return
	}
	return bcu.parseBroadcastNode(root)
}
func (day *timeURL) parseBroadcastsFromReader(read io.Reader) (ret []*r.Broadcast, err error) {
	cr := r.NewCountingReader(read)
	root, err := html.Parse(cr)
	r.ReportLoad("🐦", cr, cr, day.Source)
	if nil != err {
		return
	}
	return day.parseBroadcastsFromNode(root)
}
Beispiel #4
0
func (bc *broadcast) parseBroadcastFromHtmlReader(read io.Reader, cr0 *r.CountingReader) (ret []*r.Broadcast, err error) {
	cr := r.NewCountingReader(read)
	root, err := html.Parse(cr)
	r.ReportLoad("🐠", cr0, cr, bc.Source)
	if nil != err {
		return
	}
	return bc.parseBroadcastFromHtmlNode(root)
}
Beispiel #5
0
func (s *station) parseDayURLsReader(read io.Reader, cr0 *r.CountingReader) (ret []timeURL, err error) {
	cr := r.NewCountingReader(read)
	root, err := html.Parse(cr)
	r.ReportLoad("🐦", cr0, cr, *s.ProgramURL)
	if nil != err {
		return
	}
	ret, err = s.parseDayURLsNode(root)
	return
}
Beispiel #6
0
func (url *calItemRangeURL) parseBroadcastsReader(read io.Reader, cr0 *r.CountingReader) (bcs []r.Broadcast, err error) {
	cr := r.NewCountingReader(read)
	var f B3Programm
	err = json.NewDecoder(cr).Decode(&f)
	r.ReportLoad("🐦", cr0, cr, url.Source)
	if nil != err {
		return
	}
	return url.parseBroadcastsFromData(f)
}
Beispiel #7
0
func (day *timeURL) parseBroadcastsFromJsonReader(read io.Reader, cr0 *r.CountingReader) (ret []*broadcast, err error) {
	cr := r.NewCountingReader(read)
	var f WdrProgramm
	err = json.NewDecoder(cr).Decode(&f)
	r.ReportLoad("🐦", cr0, cr, day.Source)
	if nil != err {
		return
	}
	return day.parseBroadcastsFromJsonData(f)
}
Beispiel #8
0
func (rangeURL *calItemRangeURL) parseCalendarItemsReader(read io.Reader, cr0 *r.CountingReader) (cis []calendarItem, err error) {
	cr := r.NewCountingReader(io.LimitReader(read, 1048576))
	cis = make([]calendarItem, 0)
	err = json.NewDecoder(cr).Decode(&cis)
	r.ReportLoad("🐦", cr0, cr, rangeURL.Source)
	if nil != err {
		return
	}
	for i, _ := range cis {
		cis[i].Station = &rangeURL.Station
	}
	return
}