bigfunctions
bigfunctions copied to clipboard
[new] `get_appstore_data(url)`
with content as (
select bigfunctions.eu.get('https://play.google.com/store/apps/details?id=com.fpe.comptenickel&hl=en&gl=US', null) as text
)
select
to_json_string(
struct(
cast(regexp_extract(text, r'Rated (\d\.\d) stars out of five stars') as float64) as rating,
ifnull(
ifnull(
cast(1000000 * cast(regexp_extract(text, r'(\d+\.\d)M reviews') as float64) as int64),
cast(1000 * cast(regexp_extract(text, r'(\d+\.\d)K reviews') as float64) as int64)
),
cast(regexp_extract(text, r'(\d+\.\d) reviews') as int64)
) as nb_reviews
)
) as infos
from content
Tester pour:
- appstore
- playstore
- truspilot
- linkedin_company_profile
Hi 👋,
Is that function can be made more dynamic for Playstore or Appstore? i.e. It's not a good idea to pass in URLs of apps to get the count of reviews, ratings, etc. Someone still has to get the URL of the app's page first then only he can use it in the functions calls. If someone can get the URL then he can also get the review and rating from the page and use it for their purpose.
What if
- It can be made for two types of inputs a. If an input is a type of URL (use regex to check) then use your query. b. If an input is a type of non-URL then search for that phrase on Appstore or Playstore.
- For non-URL types we can search for that phrase on the official Playstore or Appstore and extract reviews and ratings from the top matched result.