description parsing

main
ColumbusUtrigas 2022-08-21 08:24:47 +04:00
parent 1c0fc3345e
commit 24e9d3a67d
2 changed files with 4 additions and 4 deletions

2
app.go
View File

@ -20,7 +20,7 @@ type RssEntry struct {
}
type Parser interface {
Parse() []RssEntry
Parse() []*RssEntry
Title() string
Description() string

View File

@ -11,8 +11,8 @@ import (
type NvidiaParser struct {
}
func (this NvidiaParser) Parse() []RssEntry {
var result []RssEntry
func (this NvidiaParser) Parse() []*RssEntry {
var result []*RssEntry
resp, err := http.Get(this.RootUrl() + "/publications")
if err != nil {
@ -25,7 +25,7 @@ func (this NvidiaParser) Parse() []RssEntry {
link := s.Find("a")
href, exists := link.Attr("href")
if exists {
result = append(result, RssEntry{title: link.Text(), url: this.RootUrl() + href})
result = append(result, &RssEntry{title: link.Text(), url: this.RootUrl() + href})
}
})