Implement reading xml rss feed and extracting videos
This commit is contained in:
86
youtubeWatcher/rssfeedResType.go
Normal file
86
youtubeWatcher/rssfeedResType.go
Normal file
@@ -0,0 +1,86 @@
|
||||
package main
|
||||
|
||||
import "encoding/xml"
|
||||
|
||||
type Feed struct {
|
||||
XMLName xml.Name `xml:"feed"`
|
||||
Text string `xml:",chardata"`
|
||||
Yt string `xml:"yt,attr"`
|
||||
Media string `xml:"media,attr"`
|
||||
Xmlns string `xml:"xmlns,attr"`
|
||||
Link []Link `xml:"link"`
|
||||
ID string `xml:"id"`
|
||||
ChannelId string `xml:"channelId"`
|
||||
Title string `xml:"title"`
|
||||
Author Author `xml:"author"`
|
||||
Published string `xml:"published"`
|
||||
Entry []Entry `xml:"entry"`
|
||||
}
|
||||
|
||||
type Link struct {
|
||||
Text string `xml:",chardata"`
|
||||
Rel string `xml:"rel,attr"`
|
||||
Href string `xml:"href,attr"`
|
||||
}
|
||||
|
||||
type Author struct {
|
||||
Text string `xml:",chardata"`
|
||||
Name string `xml:"name"`
|
||||
URI string `xml:"uri"`
|
||||
}
|
||||
|
||||
type Entry struct {
|
||||
Text string `xml:",chardata"`
|
||||
ID string `xml:"id"`
|
||||
VideoId string `xml:"videoId"`
|
||||
ChannelId string `xml:"channelId"`
|
||||
Title string `xml:"title"`
|
||||
Link Link `xml:"link"`
|
||||
Author Author `xml:"author"`
|
||||
Published string `xml:"published"`
|
||||
Updated string `xml:"updated"`
|
||||
Group Group `xml:"group"`
|
||||
}
|
||||
|
||||
type Group struct {
|
||||
Text string `xml:",chardata"`
|
||||
Title string `xml:"title"`
|
||||
Content Content `xml:"content"`
|
||||
Thumbnail Thumbnail `xml:"thumbnail"`
|
||||
Description string `xml:"description"`
|
||||
Community Community `xml:"community"`
|
||||
}
|
||||
|
||||
type Content struct {
|
||||
Text string `xml:",chardata"`
|
||||
URL string `xml:"url,attr"`
|
||||
Type string `xml:"type,attr"`
|
||||
Width string `xml:"width,attr"`
|
||||
Height string `xml:"height,attr"`
|
||||
}
|
||||
|
||||
type Thumbnail struct {
|
||||
Text string `xml:",chardata"`
|
||||
URL string `xml:"url,attr"`
|
||||
Width string `xml:"width,attr"`
|
||||
Height string `xml:"height,attr"`
|
||||
}
|
||||
|
||||
type Community struct {
|
||||
Text string `xml:",chardata"`
|
||||
StarRating StarRating `xml:"starRating"`
|
||||
Statistics Statistics `xml:"statistics"`
|
||||
}
|
||||
|
||||
type StarRating struct {
|
||||
Text string `xml:",chardata"`
|
||||
Count string `xml:"count,attr"`
|
||||
Average string `xml:"average,attr"`
|
||||
Min string `xml:"min,attr"`
|
||||
Max string `xml:"max,attr"`
|
||||
}
|
||||
|
||||
type Statistics struct {
|
||||
Text string `xml:",chardata"`
|
||||
Views string `xml:"views,attr"`
|
||||
}
|
||||
Reference in New Issue
Block a user