xchange-piazzola / xchange-piazzola.github.io

Welcome to xChange, a virtual exhibition of Bologna's Piazzola market.
0 stars 0 forks source link

Google Reviews (content or screenshot) #6

Open xchange-piazzola opened 5 years ago

dersuchendee commented 5 years ago

Found this snippet of code:

/**
 * Returns a list of reviews.
 * @param locationName Name of the location to retrieve reviews for.
 * @return List A list of reviews.
 * @throws Exception
 */
public static List listReviews(String locationName) throws Exception {
  Mybusiness.Accounts.Locations.Reviews.List reviewsList =
    mybusiness.accounts().locations().reviews().list(locationName);
  ListReviewsResponse response = accountsList.execute();
  List reviews = response.getReviews();

  for (Reviews review : reviews) {
    System.out.println(review.toPrettyString());
  }
  return reviews;
}

Tried widgets but one doesn't load, while the other is only for Wordpress. I'll try later! In case what do we do, do I take like 20 screenshots of the latest reviews?

dersuchendee commented 5 years ago

MADE IT, embed this

<script type="text/javascript"> 
var review_token = '9IuttysL0Vvx1dMNcKqjHYYghM62qrtoQ1hY4wp0VQqfcy190M'; 
var review_target = 'review-container'; 
</script> 
<script src="https://reviewsonmywebsite.com/js/embed.js?v=8" type="text/javascript"></script> 
<div id="review-container"></div>

only 5 because it's free subscription, but it looks nice already. Preview:

xchan3