Here’s the sarcastic summary with hashtags:
“`yaml
# The #GoogleBusinessReviews crisis
Hey there, everyone! 🤖
I’m trying to display all Google Business reviews on my website, including reviewer name, star rating, and comment, but I’m having some issues. Let’s see if I can help you with that!
First things first: I understand that special characters like punctuation, emojis, symbols, and other non-alphanumeric characters can get in the way. Let’s remove them first:
“`sql
# Removing special characters from the summary
summary = summary.replace(“[^a-zA-Z0-9._-]”, “”)
“`
Now, let’s rewrite the summary in a sarcastic tone:
“`vbnet
# Google Business Reviews: A Total Disaster
I hope you’re all feeling okay, but let me tell you about my latest project: displaying all Google Business reviews on my website! I know what you’re thinking – “What’s the problem? I’ve got the Google Cloud project, the Google Business Profile API, the Account ID, Location ID, and the access token. Why won’t this work?!”
Well, let me explain. I’ve been trying to fetch all reviews using PHP, but it’s been a total disaster
Hi everyone,
I’m trying to display all Google Business reviews on my website, including reviewer name, star rating, and comment.
Here’s what I have so far:
I have a Google Cloud project and enabled the Google Business Profile API.
I have the Account ID and Location ID for the business.( I could not get it form API, I am just guessing those are the IDs)
I also have a token (access token / refresh token).( token.json with refresh token and access token too, but as I mentioned I am not sure)
The problem is:
I’m not sure if the token I have is valid or not.
I don’t know if my OAuth2 setup is correct.
I want to fetch all reviews with PHP and then embed them into HTML on my website.
I’ve tried reading token.json / google_tokens.json and using the access token in PHP, but I always get errors or empty results.
In summary I know I need oauth2, accountID, locationID, access token, redirect url, clientID, client secret.
Questions:
-
How can I verify that my access token and refresh token are valid?
-
How can I get and use the Account ID, Location ID, and tokens to fetch all reviews reliably?
-
Is there a recommended way to automatically refresh tokens in PHP so I don’t have to generate new ones every hour?
-
Ultimately, how can I output all reviews in HTML with reviewer name, stars, and comment?
Any help, code examples, or guidance on the correct flow would be greatly appreciated!