Skip to content

Commit bdd2db7

Browse files
author
stlc-bot
committed
feat(scrape): add Yelp search parser
Merge pull request #2306 from context-dot-dev/feat/yelp-search-parser Stainless-Generated-From: 18edb4fa782172de4560dbf83e032d0f79abc97d
1 parent 5193bc1 commit bdd2db7

12 files changed

Lines changed: 318 additions & 225 deletions

‎lib/context_dev/models/batch_get_results_response.rb‎

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,11 @@ class Result < ContextDev::Internal::Type::BaseModel
190190
# data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return
191191
# one record as data, tiktok-feed returns data.videos, tiktok-comments returns
192192
# data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return
193-
# data.users, emails, phone-numbers, and links return data.emails,
194-
# data.phone_numbers, and data.links from the rendered page; the store, Maps, G2,
195-
# Instagram, and TikTok parsers read their data directly, independently of DOM
196-
# filters and other outputs.
193+
# data.users, yelp-search returns up to 20 ranked organic businesses in
194+
# data.businesses, plus total and pagination, from a Yelp search URL; emails,
195+
# phone-numbers, and links return data.emails, data.phone_numbers, and data.links
196+
# from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read
197+
# their data directly, independently of DOM filters and other outputs.
197198
#
198199
# @return [ContextDev::Models::BatchGetResultsResponse::Data::Ok::Result::Parsed]
199200
required :parsed, -> { ContextDev::Models::BatchGetResultsResponse::Data::Ok::Result::Parsed }
@@ -1027,10 +1028,11 @@ class Parsed < ContextDev::Internal::Type::BaseModel
10271028
# data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return
10281029
# one record as data, tiktok-feed returns data.videos, tiktok-comments returns
10291030
# data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return
1030-
# data.users, emails, phone-numbers, and links return data.emails,
1031-
# data.phone_numbers, and data.links from the rendered page; the store, Maps, G2,
1032-
# Instagram, and TikTok parsers read their data directly, independently of DOM
1033-
# filters and other outputs.
1031+
# data.users, yelp-search returns up to 20 ranked organic businesses in
1032+
# data.businesses, plus total and pagination, from a Yelp search URL; emails,
1033+
# phone-numbers, and links return data.emails, data.phone_numbers, and data.links
1034+
# from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read
1035+
# their data directly, independently of DOM filters and other outputs.
10341036
#
10351037
# @param data [Hash{Symbol=>Object}, nil]
10361038
#
@@ -1069,6 +1071,7 @@ module Type
10691071
TIKTOK_FOLLOWERS = :"tiktok-followers"
10701072
TIKTOK_FOLLOWING = :"tiktok-following"
10711073
TIKTOK_USER_SEARCH = :"tiktok-user-search"
1074+
YELP_SEARCH = :"yelp-search"
10721075
EMAILS = :emails
10731076
PHONE_NUMBERS = :"phone-numbers"
10741077
LINKS = :links
@@ -1592,10 +1595,11 @@ class Result < ContextDev::Internal::Type::BaseModel
15921595
# data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return
15931596
# one record as data, tiktok-feed returns data.videos, tiktok-comments returns
15941597
# data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return
1595-
# data.users, emails, phone-numbers, and links return data.emails,
1596-
# data.phone_numbers, and data.links from the rendered page; the store, Maps, G2,
1597-
# Instagram, and TikTok parsers read their data directly, independently of DOM
1598-
# filters and other outputs.
1598+
# data.users, yelp-search returns up to 20 ranked organic businesses in
1599+
# data.businesses, plus total and pagination, from a Yelp search URL; emails,
1600+
# phone-numbers, and links return data.emails, data.phone_numbers, and data.links
1601+
# from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read
1602+
# their data directly, independently of DOM filters and other outputs.
15991603
#
16001604
# @return [ContextDev::Models::BatchGetResultsResponse::Data::Error::Result::Parsed]
16011605
required :parsed, -> { ContextDev::Models::BatchGetResultsResponse::Data::Error::Result::Parsed }
@@ -2431,10 +2435,11 @@ class Parsed < ContextDev::Internal::Type::BaseModel
24312435
# data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return
24322436
# one record as data, tiktok-feed returns data.videos, tiktok-comments returns
24332437
# data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return
2434-
# data.users, emails, phone-numbers, and links return data.emails,
2435-
# data.phone_numbers, and data.links from the rendered page; the store, Maps, G2,
2436-
# Instagram, and TikTok parsers read their data directly, independently of DOM
2437-
# filters and other outputs.
2438+
# data.users, yelp-search returns up to 20 ranked organic businesses in
2439+
# data.businesses, plus total and pagination, from a Yelp search URL; emails,
2440+
# phone-numbers, and links return data.emails, data.phone_numbers, and data.links
2441+
# from the rendered page; the store, Maps, G2, Instagram, and TikTok parsers read
2442+
# their data directly, independently of DOM filters and other outputs.
24382443
#
24392444
# @param data [Hash{Symbol=>Object}, nil]
24402445
#
@@ -2473,6 +2478,7 @@ module Type
24732478
TIKTOK_FOLLOWERS = :"tiktok-followers"
24742479
TIKTOK_FOLLOWING = :"tiktok-following"
24752480
TIKTOK_USER_SEARCH = :"tiktok-user-search"
2481+
YELP_SEARCH = :"yelp-search"
24762482
EMAILS = :emails
24772483
PHONE_NUMBERS = :"phone-numbers"
24782484
LINKS = :links

‎lib/context_dev/models/batch_submit_params.rb‎

Lines changed: 54 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,17 +1667,19 @@ class PrebuiltParser < ContextDev::Internal::Type::BaseModel
16671667
# (/search/user?q={query}) as data.users: id, username, nickname, biography,
16681668
# avatar_url, sec_uid, follower_count, like_count, and is_verified. The TikTok
16691669
# parsers accept tiktok.com, www.tiktok.com, and m.tiktok.com URLs but not short
1670-
# links (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/…). emails accepts any page
1671-
# and returns its email addresses as data.emails ([{ email }]), read from mailto
1672-
# links, Cloudflare-protected addresses, and visible text. phone-numbers accepts
1673-
# any page and returns its valid phone numbers in E.164 as data.phone_numbers ([{
1674-
# phone }]), read from tel links and visible text; numbers without a country code
1675-
# are read for the country of the site TLD, defaulting to US. links accepts any
1676-
# page and returns its unique http(s) links as data.links ([{ url, text }]), with
1677-
# absolute URLs; text falls back to aria-label or image alt and is null when a
1678-
# link has none. The emails parser reads the rendered page and respects content
1679-
# filters; the other prebuilt parsers read their data independently of DOM
1680-
# filters.
1670+
# links (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/…). yelp-search accepts Yelp
1671+
# search URLs with find_desc and find_loc, reads start as the result offset, and
1672+
# returns up to 20 ranked organic businesses in data.businesses with total and
1673+
# pagination. emails accepts any page and returns its email addresses as
1674+
# data.emails ([{ email }]), read from mailto links, Cloudflare-protected
1675+
# addresses, and visible text. phone-numbers accepts any page and returns its
1676+
# valid phone numbers in E.164 as data.phone_numbers ([{ phone }]), read from tel
1677+
# links and visible text; numbers without a country code are read for the country
1678+
# of the site TLD, defaulting to US. links accepts any page and returns its unique
1679+
# http(s) links as data.links ([{ url, text }]), with absolute URLs; text falls
1680+
# back to aria-label or image alt and is null when a link has none. The emails
1681+
# parser reads the rendered page and respects content filters; the other prebuilt
1682+
# parsers read their data independently of DOM filters.
16811683
#
16821684
# @return [Symbol, ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::BatchUnifiedScrapeData::ParseParams::PrebuiltParser::Parser]
16831685
required :parser,
@@ -1776,17 +1778,19 @@ class PrebuiltParser < ContextDev::Internal::Type::BaseModel
17761778
# (/search/user?q={query}) as data.users: id, username, nickname, biography,
17771779
# avatar_url, sec_uid, follower_count, like_count, and is_verified. The TikTok
17781780
# parsers accept tiktok.com, www.tiktok.com, and m.tiktok.com URLs but not short
1779-
# links (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/…). emails accepts any page
1780-
# and returns its email addresses as data.emails ([{ email }]), read from mailto
1781-
# links, Cloudflare-protected addresses, and visible text. phone-numbers accepts
1782-
# any page and returns its valid phone numbers in E.164 as data.phone_numbers ([{
1783-
# phone }]), read from tel links and visible text; numbers without a country code
1784-
# are read for the country of the site TLD, defaulting to US. links accepts any
1785-
# page and returns its unique http(s) links as data.links ([{ url, text }]), with
1786-
# absolute URLs; text falls back to aria-label or image alt and is null when a
1787-
# link has none. The emails parser reads the rendered page and respects content
1788-
# filters; the other prebuilt parsers read their data independently of DOM
1789-
# filters.
1781+
# links (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/…). yelp-search accepts Yelp
1782+
# search URLs with find_desc and find_loc, reads start as the result offset, and
1783+
# returns up to 20 ranked organic businesses in data.businesses with total and
1784+
# pagination. emails accepts any page and returns its email addresses as
1785+
# data.emails ([{ email }]), read from mailto links, Cloudflare-protected
1786+
# addresses, and visible text. phone-numbers accepts any page and returns its
1787+
# valid phone numbers in E.164 as data.phone_numbers ([{ phone }]), read from tel
1788+
# links and visible text; numbers without a country code are read for the country
1789+
# of the site TLD, defaulting to US. links accepts any page and returns its unique
1790+
# http(s) links as data.links ([{ url, text }]), with absolute URLs; text falls
1791+
# back to aria-label or image alt and is null when a link has none. The emails
1792+
# parser reads the rendered page and respects content filters; the other prebuilt
1793+
# parsers read their data independently of DOM filters.
17901794
#
17911795
# @see ContextDev::Models::BatchSubmitParams::Input::Scrape::Data::BatchUnifiedScrapeData::ParseParams::PrebuiltParser#parser
17921796
module Parser
@@ -1809,6 +1813,7 @@ module Parser
18091813
TIKTOK_FOLLOWERS = :"tiktok-followers"
18101814
TIKTOK_FOLLOWING = :"tiktok-following"
18111815
TIKTOK_USER_SEARCH = :"tiktok-user-search"
1816+
YELP_SEARCH = :"yelp-search"
18121817
EMAILS = :emails
18131818
PHONE_NUMBERS = :"phone-numbers"
18141819
LINKS = :links
@@ -4969,17 +4974,19 @@ class PrebuiltParser < ContextDev::Internal::Type::BaseModel
49694974
# (/search/user?q={query}) as data.users: id, username, nickname, biography,
49704975
# avatar_url, sec_uid, follower_count, like_count, and is_verified. The TikTok
49714976
# parsers accept tiktok.com, www.tiktok.com, and m.tiktok.com URLs but not short
4972-
# links (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/…). emails accepts any page
4973-
# and returns its email addresses as data.emails ([{ email }]), read from mailto
4974-
# links, Cloudflare-protected addresses, and visible text. phone-numbers accepts
4975-
# any page and returns its valid phone numbers in E.164 as data.phone_numbers ([{
4976-
# phone }]), read from tel links and visible text; numbers without a country code
4977-
# are read for the country of the site TLD, defaulting to US. links accepts any
4978-
# page and returns its unique http(s) links as data.links ([{ url, text }]), with
4979-
# absolute URLs; text falls back to aria-label or image alt and is null when a
4980-
# link has none. The emails parser reads the rendered page and respects content
4981-
# filters; the other prebuilt parsers read their data independently of DOM
4982-
# filters.
4977+
# links (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/…). yelp-search accepts Yelp
4978+
# search URLs with find_desc and find_loc, reads start as the result offset, and
4979+
# returns up to 20 ranked organic businesses in data.businesses with total and
4980+
# pagination. emails accepts any page and returns its email addresses as
4981+
# data.emails ([{ email }]), read from mailto links, Cloudflare-protected
4982+
# addresses, and visible text. phone-numbers accepts any page and returns its
4983+
# valid phone numbers in E.164 as data.phone_numbers ([{ phone }]), read from tel
4984+
# links and visible text; numbers without a country code are read for the country
4985+
# of the site TLD, defaulting to US. links accepts any page and returns its unique
4986+
# http(s) links as data.links ([{ url, text }]), with absolute URLs; text falls
4987+
# back to aria-label or image alt and is null when a link has none. The emails
4988+
# parser reads the rendered page and respects content filters; the other prebuilt
4989+
# parsers read their data independently of DOM filters.
49834990
#
49844991
# @return [Symbol, ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::BatchUnifiedCrawlData::ParseParams::PrebuiltParser::Parser]
49854992
required :parser,
@@ -5078,17 +5085,19 @@ class PrebuiltParser < ContextDev::Internal::Type::BaseModel
50785085
# (/search/user?q={query}) as data.users: id, username, nickname, biography,
50795086
# avatar_url, sec_uid, follower_count, like_count, and is_verified. The TikTok
50805087
# parsers accept tiktok.com, www.tiktok.com, and m.tiktok.com URLs but not short
5081-
# links (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/…). emails accepts any page
5082-
# and returns its email addresses as data.emails ([{ email }]), read from mailto
5083-
# links, Cloudflare-protected addresses, and visible text. phone-numbers accepts
5084-
# any page and returns its valid phone numbers in E.164 as data.phone_numbers ([{
5085-
# phone }]), read from tel links and visible text; numbers without a country code
5086-
# are read for the country of the site TLD, defaulting to US. links accepts any
5087-
# page and returns its unique http(s) links as data.links ([{ url, text }]), with
5088-
# absolute URLs; text falls back to aria-label or image alt and is null when a
5089-
# link has none. The emails parser reads the rendered page and respects content
5090-
# filters; the other prebuilt parsers read their data independently of DOM
5091-
# filters.
5088+
# links (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/…). yelp-search accepts Yelp
5089+
# search URLs with find_desc and find_loc, reads start as the result offset, and
5090+
# returns up to 20 ranked organic businesses in data.businesses with total and
5091+
# pagination. emails accepts any page and returns its email addresses as
5092+
# data.emails ([{ email }]), read from mailto links, Cloudflare-protected
5093+
# addresses, and visible text. phone-numbers accepts any page and returns its
5094+
# valid phone numbers in E.164 as data.phone_numbers ([{ phone }]), read from tel
5095+
# links and visible text; numbers without a country code are read for the country
5096+
# of the site TLD, defaulting to US. links accepts any page and returns its unique
5097+
# http(s) links as data.links ([{ url, text }]), with absolute URLs; text falls
5098+
# back to aria-label or image alt and is null when a link has none. The emails
5099+
# parser reads the rendered page and respects content filters; the other prebuilt
5100+
# parsers read their data independently of DOM filters.
50925101
#
50935102
# @see ContextDev::Models::BatchSubmitParams::Input::Crawl::Data::BatchUnifiedCrawlData::ParseParams::PrebuiltParser#parser
50945103
module Parser
@@ -5111,6 +5120,7 @@ module Parser
51115120
TIKTOK_FOLLOWERS = :"tiktok-followers"
51125121
TIKTOK_FOLLOWING = :"tiktok-following"
51135122
TIKTOK_USER_SEARCH = :"tiktok-user-search"
5123+
YELP_SEARCH = :"yelp-search"
51145124
EMAILS = :emails
51155125
PHONE_NUMBERS = :"phone-numbers"
51165126
LINKS = :links

0 commit comments

Comments
 (0)