Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

google-maps-reviews

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-maps-reviews

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

  • 0.0.21
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
85
increased by73.47%
Maintainers
1
Weekly downloads
 
Created
Source

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

project on npm: https://www.npmjs.com/package/google-maps-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
    max_rows: 6, // max rows of reviews to be displayed
    min_rating: 4, // minimum rating of reviews to be displayed
    months: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"],
    text_break_length: "90", // length before a review box is set to max width
    show_date: false, // renders the date of the review before the review itself
    shorten_names: true, // example: "Max Mustermann" -> "Max M.""
    replace_anonymous: false, // do not replace anonymous author_name from JSON
    anonymous_name: "A Google User", // Google's default value depending on language used (en: "A Google User")
    anonymous_name_replacement: "User chose to remain anonymous", // replacement for default (never shortens)
  });
});
</script>

Are Pull Requests welcome?

Yes, of course :octocat:

Keywords

FAQs

Package last updated on 11 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc