-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into LANTERN-803-add-webscraper-chntechsolns
- Loading branch information
Showing
9 changed files
with
93 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
endpointmanager/pkg/chplendpointquerier/correctekwebscraper.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
endpointmanager/pkg/chplendpointquerier/zoobooksystemswebscraper.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package chplendpointquerier | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/PuerkitoBio/goquery" | ||
"github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" | ||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
func ZoobooksystemsWebscraper(CHPLURL string, fileToWriteTo string) error { | ||
|
||
var lanternEntryList []LanternEntry | ||
var endpointEntryList EndpointList | ||
doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, ".col-lg-6.text-secondary.fw-bold") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
inProduction := false | ||
|
||
doc.Find(".col-lg-6").Each(func(index int, divhtml *goquery.Selection) { | ||
if divhtml.Text() == "PRODUCTION" { | ||
inProduction = true | ||
} | ||
|
||
if inProduction { | ||
divhtml.Find("a").Each(func(indextr int, ahtml *goquery.Selection) { | ||
if strings.Contains(ahtml.Text(), "https") && !strings.Contains(ahtml.Text(), "oauth") { | ||
var entry LanternEntry | ||
|
||
entryURL := strings.TrimSpace(ahtml.Text()) | ||
entry.URL = entryURL | ||
|
||
lanternEntryList = append(lanternEntryList, entry) | ||
|
||
endpointEntryList.Endpoints = lanternEntryList | ||
|
||
err = WriteCHPLFile(endpointEntryList, fileToWriteTo) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
return | ||
} | ||
}) | ||
} | ||
}) | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters