You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 54d8fb4
Browse filesBrowse the repository at this point in the historyBrowse files
stlc-bot
committed
feat(scrape): add Yelp reviews parser
Merge pull request #2307 from context-dot-dev/feat/yelp-reviews-parser
Stainless-Generated-From: 0e315e503e18ef2869595fc64880edb2674536ad
Copy file name to clipboardExpand all lines: src/context/dev/types/batch_get_results_response.py
+16-10Lines changed: 16 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -294,7 +294,7 @@ class DataOkResultMetadata(BaseModel):
294
294
295
295
classDataOkResultParsed(BaseModel):
296
296
"""
297
-
Custom rules return fields after content filters; unmatched fields are null ([] for lists). The google-maps parser returns business records in data.results, google-maps-reviews returns data.reviews, and the google-play parser returns one app record as data, google-play-reviews returns data.reviews, app-store and app-store-reviews do the same for the App Store, g2-reviews returns data.reviews for a G2 product, instagram-profile and instagram-post return one record as data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return one record as data, tiktok-feed returns data.videos, tiktok-comments returns data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return data.users, yelp-search returns up to 20 ranked organic businesses in data.businesses, plus total and pagination, from a Yelp search URL; emails, phone-numbers, and links return data.emails, data.phone_numbers, and data.links from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read their data directly, independently of DOM filters and other outputs.
297
+
Custom rules return fields after content filters; unmatched fields are null ([] for lists). The google-maps parser returns business records in data.results, google-maps-reviews returns data.reviews, and the google-play parser returns one app record as data, google-play-reviews returns data.reviews, app-store and app-store-reviews do the same for the App Store, g2-reviews returns data.reviews for a G2 product, instagram-profile and instagram-post return one record as data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return one record as data, tiktok-feed returns data.videos, tiktok-comments returns data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return data.users, yelp-search returns up to 20 ranked organic businesses in data.businesses, plus total and pagination, from a Yelp search URL; yelp-reviews returns up to 20 latest public reviews in data.reviews, with business details and next_offset, from a Yelp business URL; emails, phone-numbers, and links return data.emails, data.phone_numbers, and data.links from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read their data directly, independently of DOM filters and other outputs.
298
298
"""
299
299
300
300
data: Optional[Dict[str, object]] =None
@@ -324,6 +324,7 @@ class DataOkResultParsed(BaseModel):
324
324
"tiktok-following",
325
325
"tiktok-user-search",
326
326
"yelp-search",
327
+
"yelp-reviews",
327
328
"emails",
328
329
"phone-numbers",
329
330
"links",
@@ -524,10 +525,12 @@ class DataOkResult(BaseModel):
524
525
one record as data, tiktok-feed returns data.videos, tiktok-comments returns
525
526
data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return
526
527
data.users, yelp-search returns up to 20 ranked organic businesses in
527
-
data.businesses, plus total and pagination, from a Yelp search URL; emails,
528
-
phone-numbers, and links return data.emails, data.phone_numbers, and data.links
529
-
from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read
530
-
their data directly, independently of DOM filters and other outputs.
528
+
data.businesses, plus total and pagination, from a Yelp search URL; yelp-reviews
529
+
returns up to 20 latest public reviews in data.reviews, with business details
530
+
and next_offset, from a Yelp business URL; emails, phone-numbers, and links
531
+
return data.emails, data.phone_numbers, and data.links from the rendered page;
532
+
the store, Maps, G2, Instagram, and TikTok parsers read their data directly,
533
+
independently of DOM filters and other outputs.
531
534
"""
532
535
533
536
product: DataOkResultProduct
@@ -829,7 +832,7 @@ class DataErrorResultMetadata(BaseModel):
829
832
830
833
classDataErrorResultParsed(BaseModel):
831
834
"""
832
-
Custom rules return fields after content filters; unmatched fields are null ([] for lists). The google-maps parser returns business records in data.results, google-maps-reviews returns data.reviews, and the google-play parser returns one app record as data, google-play-reviews returns data.reviews, app-store and app-store-reviews do the same for the App Store, g2-reviews returns data.reviews for a G2 product, instagram-profile and instagram-post return one record as data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return one record as data, tiktok-feed returns data.videos, tiktok-comments returns data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return data.users, yelp-search returns up to 20 ranked organic businesses in data.businesses, plus total and pagination, from a Yelp search URL; emails, phone-numbers, and links return data.emails, data.phone_numbers, and data.links from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read their data directly, independently of DOM filters and other outputs.
835
+
Custom rules return fields after content filters; unmatched fields are null ([] for lists). The google-maps parser returns business records in data.results, google-maps-reviews returns data.reviews, and the google-play parser returns one app record as data, google-play-reviews returns data.reviews, app-store and app-store-reviews do the same for the App Store, g2-reviews returns data.reviews for a G2 product, instagram-profile and instagram-post return one record as data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return one record as data, tiktok-feed returns data.videos, tiktok-comments returns data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return data.users, yelp-search returns up to 20 ranked organic businesses in data.businesses, plus total and pagination, from a Yelp search URL; yelp-reviews returns up to 20 latest public reviews in data.reviews, with business details and next_offset, from a Yelp business URL; emails, phone-numbers, and links return data.emails, data.phone_numbers, and data.links from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read their data directly, independently of DOM filters and other outputs.
833
836
"""
834
837
835
838
data: Optional[Dict[str, object]] =None
@@ -859,6 +862,7 @@ class DataErrorResultParsed(BaseModel):
859
862
"tiktok-following",
860
863
"tiktok-user-search",
861
864
"yelp-search",
865
+
"yelp-reviews",
862
866
"emails",
863
867
"phone-numbers",
864
868
"links",
@@ -1060,10 +1064,12 @@ class DataErrorResult(BaseModel):
1060
1064
one record as data, tiktok-feed returns data.videos, tiktok-comments returns
1061
1065
data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return
1062
1066
data.users, yelp-search returns up to 20 ranked organic businesses in
1063
-
data.businesses, plus total and pagination, from a Yelp search URL; emails,
1064
-
phone-numbers, and links return data.emails, data.phone_numbers, and data.links
1065
-
from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read
1066
-
their data directly, independently of DOM filters and other outputs.
1067
+
data.businesses, plus total and pagination, from a Yelp search URL; yelp-reviews
1068
+
returns up to 20 latest public reviews in data.reviews, with business details
1069
+
and next_offset, from a Yelp business URL; emails, phone-numbers, and links
1070
+
return data.emails, data.phone_numbers, and data.links from the rendered page;
1071
+
the store, Maps, G2, Instagram, and TikTok parsers read their data directly,
Copy file name to clipboardExpand all lines: src/context/dev/types/web_scrape_response.py
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -267,7 +267,7 @@ class Metadata(BaseModel):
267
267
268
268
classParsed(BaseModel):
269
269
"""
270
-
Custom rules return fields after content filters; unmatched fields are null ([] for lists). The google-maps parser returns business records in data.results, google-maps-reviews returns data.reviews, and the google-play parser returns one app record as data, google-play-reviews returns data.reviews, app-store and app-store-reviews do the same for the App Store, g2-reviews returns data.reviews for a G2 product, instagram-profile and instagram-post return one record as data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return one record as data, tiktok-feed returns data.videos, tiktok-comments returns data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return data.users, yelp-search returns up to 20 ranked organic businesses in data.businesses, plus total and pagination, from a Yelp search URL; emails, phone-numbers, and links return data.emails, data.phone_numbers, and data.links from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read their data directly, independently of DOM filters and other outputs.
270
+
Custom rules return fields after content filters; unmatched fields are null ([] for lists). The google-maps parser returns business records in data.results, google-maps-reviews returns data.reviews, and the google-play parser returns one app record as data, google-play-reviews returns data.reviews, app-store and app-store-reviews do the same for the App Store, g2-reviews returns data.reviews for a G2 product, instagram-profile and instagram-post return one record as data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return one record as data, tiktok-feed returns data.videos, tiktok-comments returns data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return data.users, yelp-search returns up to 20 ranked organic businesses in data.businesses, plus total and pagination, from a Yelp search URL; yelp-reviews returns up to 20 latest public reviews in data.reviews, with business details and next_offset, from a Yelp business URL; emails, phone-numbers, and links return data.emails, data.phone_numbers, and data.links from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read their data directly, independently of DOM filters and other outputs.
271
271
"""
272
272
273
273
data: Optional[Dict[str, object]] =None
@@ -297,6 +297,7 @@ class Parsed(BaseModel):
297
297
"tiktok-following",
298
298
"tiktok-user-search",
299
299
"yelp-search",
300
+
"yelp-reviews",
300
301
"emails",
301
302
"phone-numbers",
302
303
"links",
@@ -493,10 +494,12 @@ class WebScrapeResponse(BaseModel):
493
494
one record as data, tiktok-feed returns data.videos, tiktok-comments returns
494
495
data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return
495
496
data.users, yelp-search returns up to 20 ranked organic businesses in
496
-
data.businesses, plus total and pagination, from a Yelp search URL; emails,
497
-
phone-numbers, and links return data.emails, data.phone_numbers, and data.links
498
-
from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read
499
-
their data directly, independently of DOM filters and other outputs.
497
+
data.businesses, plus total and pagination, from a Yelp search URL; yelp-reviews
498
+
returns up to 20 latest public reviews in data.reviews, with business details
499
+
and next_offset, from a Yelp business URL; emails, phone-numbers, and links
500
+
return data.emails, data.phone_numbers, and data.links from the rendered page;
501
+
the store, Maps, G2, Instagram, and TikTok parsers read their data directly,
0 commit comments