gmaps: Add extended review fields (source, language, timestamps, reply)#272
Open
knoellp wants to merge 4 commits into
Open
gmaps: Add extended review fields (source, language, timestamps, reply)#272knoellp wants to merge 4 commits into
knoellp wants to merge 4 commits into
Conversation
Integrates our 5 custom fixes (originally written against playwright.Page) into the upstream scrapemate.BrowserPage interface introduced in eef673b. Changes: - job.go: ignore WaitForURL errors instead of returning (proxy latency fix) - job.go: increase div[role='feed'] WaitForSelector timeout 700ms → 10s - place.go: ignore WaitForURL errors instead of returning - place.go: lower ExtraReviews threshold >8 → >0 (fetch reviews for all places) - emailjob.go: add normalizeGoogleURL() to unwrap Google redirect URLs (/url?q=http://...) before creating the email extraction job Dropped: playwright-specific debug infrastructure (setupPageListeners, saveDebugInfo) — not compatible with scrapemate.BrowserPage. Dropped: f9db0ea JS key search and ae900fb nil-check — already superseded by upstream's eef673b implementation.
# Conflicts: # gmaps/emailjob.go
… reply data, timestamps
Contributor
Author
|
The CI failure in the "Go Vulnerability Check" step is a pre-existing issue unrelated to this PR. The check reports known vulnerabilities in the Go 1.26.2 standard library (net/mail, html/template) that were fixed in Go 1.26.3. The same failure occurs on main before any changes from this PR are applied. Once the toolchain is updated to Go 1.26.3+, the vulnerability check should pass. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch extends the
Reviewstruct ingmaps/entry.gowith 17 additional fields that expose richer metadata from thelistugcpostsRPC response. All existing fields (Name,ProfilePicture,Rating,Description,Images,When) remain semantically unchanged, preserving backward compatibility with existing consumers.The new fields cover four areas: review identity (
ReviewID), source metadata (Source,RatingScale,AuthorURL,PostedAtUnixMicros,UpdatedAtUnixMicros), language and text (Language,TranslatedLang,TextOriginal,TextTranslated,RatingFloat), and owner reply (ReplyText,ReplyTextOriginal,ReplyLanguage,ReplyTranslatedLang,ReplyPostedAtUnixMicros,ReplyUpdatedAtUnixMicros).Aggregator reviews (Tripadvisor, Trip.com, etc.) are detected by checking whether
r[2][0]is nil. In that case,Ratingstays at 0 (matching the previous behavior) andRatingFloatis read fromr[2][8][1]. For native Google reviews,RatingFloatmirrorsfloat64(Rating).Reply fields use
omitemptyJSON tags and are only populated when the reply block atr[3]is present and non-nil, keeping serialized output clean for reviews without replies.The patch adds four test cases covering: a native review with a translated text and owner reply, a synthetic aggregator review, a rating-only review with no text body, and a native review without translation. All pre-existing tests continue to pass.
New fields summary
ReviewIDreview_idr[0]PostedAtUnixMicrosposted_at_unix_microsr[1][2]UpdatedAtUnixMicrosupdated_at_unix_microsr[1][3]AuthorURLauthor_urlr[1][4][2][0]Sourcesourcer[1][13][0]RatingScalerating_scaler[1][13][4]Languagelanguager[2][14][0]TranslatedLangtranslated_langr[2][14][1]TextOriginaltext_originalr[2][15][0][0]TextTranslatedtext_translatedr[2][15][1][0]RatingFloatrating_floatr[2][8][1](aggregator) /float64(Rating)(native)ReplyPostedAtUnixMicrosreply_posted_at_unix_micros,omitemptyr[3][1]ReplyUpdatedAtUnixMicrosreply_updated_at_unix_micros,omitemptyr[3][2]ReplyLanguagereply_language,omitemptyr[3][13][0]ReplyTranslatedLangreply_translated_lang,omitemptyr[3][13][1]ReplyTextOriginalreply_text_original,omitemptyr[3][14][0][0]ReplyTextreply_text,omitemptyr[3][14][1][0]