npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

google-maps-reviews

v0.3.0

Published

Display Google Reviews of a Place on Google Maps on your website

Downloads

480

Readme

Display Google Reviews of a Place on Google Maps on your website

project on npm: https://www.npmjs.com/package/google-maps-reviews

jQuery Version here: https://github.com/simonneutert/jquery-google-reviews

Credits

Inspired by Steven Monson's magnificent article here: https://www.launch2success.com/guide/display-google-reviews-website-2017/ or check out Steven's github. Steven's code is based on peledies jquery plugin repo. So, I simply remixed their work into this repo. Thank you guys!

Dear beginners and copy-pasters

:octocat: For those of you, who are new in programming or can only copy-paste, please make sure, that the Google Maps API and the .js-file of this plugin are successfully loaded before you call this script in the body your html page.

under demo/index.html is a working demo, the comments will guide you :wink:

Prerequisites

either

  • add the .js and .css of this repo to your project (see index.html for inspiration :wink:)

or

  • $ npm install -i google-maps-reviews

then

  • if you do not have a working Google Maps API key already: create a Google API Key: https://console.developers.google.com/apis/

  • add the following line with your Google Maps API key with the key param:

    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&key=YourApiKeyHere"></script>
  • add an empty div element in your html's body with an unique ID, where the reviews should show up. In this case:

    <div id="google-reviews"></div>

Call the Plugin

Grab your place's ID (https://developers.google.com/places/place-id) and call it as placeId parameter, when calling the plugin.

<!-- add this before </body> -->
<script>
    // Find a placeID via https://developers.google.com/places/place-id
    googlePlaces("google-reviews", {
      placeId: 'ChIJZa6ezJa8j4AR1p1nTSaRtuQ',
      // the following params are optional (default values)
      header: "<h3>Google Reviews</h3>", // html/text over Reviews
      footer: '', // html/text under Reviews block
      maxRows: 6, // max rows of reviews to be displayed
      minRating: 4, // minimum rating of reviews to be displayed
      months: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"],
      textBreakLength: "90", // length before a review box is set to max width
      showDate: false, // renders the date of the review before the review itself
      shortenNames: true, // example: "Max Mustermann" -> "Max M.""
      replaceAnonymous: false, // do not replace anonymous author_name from JSON
      anonymousName: "A Google User", // Google's default value depending on language used (en: "A Google User")
      anonymousNameReplacement: "User chose to remain anonymous", // replacement for default (never shortens)
    });
  });
</script>

Are Pull Requests welcome?

Yes, of course :octocat: