Skip to content

Commit

Permalink
Fix progress bars
Browse files Browse the repository at this point in the history
  • Loading branch information
LewsTherinTelescope authored and marvin-roesch committed Aug 27, 2024
1 parent 4238a73 commit b89344e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (plugin ProgressPlugin) Check(offset interface{}, context PluginContext) (i
}

func readProgress(doc *goquery.Document) ([]Progress, error) {
bars := doc.Find(".vc_progress_bar .vc_label")
bars := doc.Find("[class^=progress-item-template]")
result := make([]Progress, bars.Length())

if bars.Length() == 0 {
Expand All @@ -104,9 +104,9 @@ func readProgress(doc *goquery.Document) ([]Progress, error) {
}

bars.Each(func(i int, selection *goquery.Selection) {
title := strings.TrimSpace(selection.Contents().Not("span").Text())
title := strings.TrimSpace(selection.Find("[class^=progress-title-template]").Text())
link := selection.Find("a").AttrOr("href", "")
value := selection.NextFiltered(".vc_single_bar").Find(".vc_bar").AttrOr("data-percentage-value", "0")
value := strings.TrimSuffix(selection.Find("[class^=progress-percent-template]").Text(), "%")

parsedValue, _ := strconv.Atoi(value)

Expand Down

0 comments on commit b89344e

Please sign in to comment.