Skip to content

Commit

Permalink
fix bug #54
Browse files Browse the repository at this point in the history
  • Loading branch information
cishiv committed Mar 24, 2020
1 parent d2d13ea commit f90cb80
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scraper/cli.go
Expand Up @@ -19,7 +19,7 @@ import (
func Init(args []string) {
fmt.Println("[WARNING] Please note that media statements prior to (16-03-2020) may not be parseable due to inconsistent html formatting")
if len(args) == 0 {
log.Fatal("[ERROR] Please pass an argument to the tool {nicd, sacovid}")
log.Fatal("[ERROR] Please pass an argument to the tool {nicd, cov}")
}
parse(args[0])
}
Expand All @@ -29,7 +29,7 @@ func invalidArgs() {
}

func parse(opt string) {
fmt.Println("[INFO] Selected " + NEWSROOM)
fmt.Println("[INFO] Selected " + opt)
prevID := establishContext()
if strings.EqualFold(opt, "nicd") {
results := Crawl(Request(NEWSROOM), "1")
Expand Down Expand Up @@ -182,7 +182,9 @@ func ParseNICD(r Result, id int) []Instance {
dateString = s.Text()
}
})

doc.Find("strong").Each(func(i int, s *goquery.Selection) {
fmt.Println(s.Text())
selections := s.Parent().Next().Find("li")
if selections != nil {
selections.Each(func(i int, is *goquery.Selection) {
Expand Down
2 changes: 1 addition & 1 deletion scraper/declare.go
Expand Up @@ -85,7 +85,7 @@ type Date struct {

var BIOGRAPHICAL = regexp.MustCompile("A.*male")
var NO_GENDER_FOUND = regexp.MustCompile("A.*-year-old")
var AGE = regexp.MustCompile("[0-9]+")
var AGE = regexp.MustCompile("[0-9]+|[x]")
var GENDER = regexp.MustCompile("male|female")

// this breaks if the date format changes on the gov site
Expand Down
Binary file modified scraper/scraper
Binary file not shown.

0 comments on commit f90cb80

Please sign in to comment.