Skip to content

Commit

Permalink
Refactor (#101)
Browse files Browse the repository at this point in the history
* Use loop

* Fix docker version tag
  • Loading branch information
raviqqe authored Sep 23, 2020
1 parent ba7d819 commit dccf094
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions page_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ func (p pageParser) Parse(rawURL string, body []byte) (*page, error) {
frs := map[string]struct{}{}

scrape.FindAllNested(n, func(n *html.Node) bool {
if s := scrape.Attr(n, "id"); s != "" {
frs[s] = struct{}{}
}

if s := scrape.Attr(n, "name"); s != "" {
frs[s] = struct{}{}
for _, a := range []string{"id", "name"} {
if s := scrape.Attr(n, a); s != "" {
frs[s] = struct{}{}
}
}

return false
Expand Down
2 changes: 1 addition & 1 deletion tools/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

for tag in latest $(git tag --points-at); do
for tag in latest $(git tag --points-at | sed s/^v//); do
docker build -t raviqqe/muffet:$tag .
docker push raviqqe/muffet:$tag
done

0 comments on commit dccf094

Please sign in to comment.