From 1f65a8f35f177073717fd88a07d9dccdf546b04a Mon Sep 17 00:00:00 2001 From: midir99 Date: Mon, 8 Aug 2022 23:33:03 -0500 Subject: [PATCH] Add more data to the scraper of cdmx-custom and update the version number --- cmd/cmd.go | 2 +- ws/cdmx.go | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index ba7c915..8db9625 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -133,7 +133,7 @@ func ParseArgs() (*Args, error) { } func PrintVersion() { - fmt.Println("rastreadora v0.4.0") + fmt.Println("rastreadora v0.5.1") } func SelectScraperFuncs(alertType AlertType) (func(*doc.Doc) ([]mpp.MissingPersonPoster, map[int]error), func(uint64) string, error) { diff --git a/ws/cdmx.go b/ws/cdmx.go index a9ae27d..a6dc2f5 100644 --- a/ws/cdmx.go +++ b/ws/cdmx.go @@ -133,14 +133,16 @@ func ScrapeCdmxCustomAlerts(d *doc.Doc) ([]mpp.MissingPersonPoster, map[int]erro if len(ageLegend) == 2 { age, _ = ParseCdmxAge(ageLegend[1]) } + cbsLegend := strings.TrimSpace(strings.ReplaceAll(dataTd.NthChild(6).Text(), "\u00A0", " ")) mpps = append(mpps, mpp.MissingPersonPoster{ - Found: found, - MissingDate: missingDate, - MpAgeWhenDisappeared: age, - MpName: mpName, - PoPosterUrl: poPosterUrl, - PoPostUrl: poPostUrl, - PoState: mpp.StateCiudadDeMexico, + CircumstancesBehindDissapearance: cbsLegend, + Found: found, + MissingDate: missingDate, + MpAgeWhenDisappeared: age, + MpName: mpName, + PoPosterUrl: poPosterUrl, + PoPostUrl: poPostUrl, + PoState: mpp.StateCiudadDeMexico, }) } return mpps, errs