Skip to content

Commit

Permalink
Merge pull request gocolly#263 from egens/patch-1
Browse files Browse the repository at this point in the history
Fix reddit example
  • Loading branch information
asciimoo authored Jan 21, 2019
2 parents a8a1b8b + dcd56b5 commit a58f307
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _examples/reddit/reddit.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ func main() {
stories := []item{}
// Instantiate default collector
c := colly.NewCollector(
// Visit only domains: reddit.com
colly.AllowedDomains("www.reddit.com"),
// Visit only domains: old.reddit.com
colly.AllowedDomains("old.reddit.com"),
colly.Async(true),
)

Expand All @@ -31,7 +31,7 @@ func main() {
c.OnHTML(".top-matter", func(e *colly.HTMLElement) {
temp := item{}
temp.StoryURL = e.ChildAttr("a[data-event-action=title]", "href")
temp.Source = "https://www.reddit.com/r/programming/"
temp.Source = "https://old.reddit.com/r/programming/"
temp.Title = e.ChildText("a[data-event-action=title]")
temp.Comments = e.ChildAttr("a[data-event-action=comments]", "href")
temp.CrawledAt = time.Now()
Expand Down

0 comments on commit a58f307

Please sign in to comment.