description parsing
parent
1c0fc3345e
commit
24e9d3a67d
2
app.go
2
app.go
|
|
@ -20,7 +20,7 @@ type RssEntry struct {
|
|||
}
|
||||
|
||||
type Parser interface {
|
||||
Parse() []RssEntry
|
||||
Parse() []*RssEntry
|
||||
|
||||
Title() string
|
||||
Description() string
|
||||
|
|
|
|||
|
|
@ -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})
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue