Code Monkey home page Code Monkey logo

google-reviews's Introduction

Google Reviews

Use the Google Places API to display Google business reviews on your website.

Note: The JS was originally sourced from Peledies Google Places jQuery Plugin (here) although I've tweaked it a little with additional schema, user avatars, less convoluted mark-up and limited the functionality to only show reviews.

The file (reviews.php) is more contained (no external JS, aside from the jQuery requirement) and also inludes a simple configuration via a bunch of PHP variables. You could just make it a server side include and not have to think about it.

Requirements: Google maps API key, with Maps JavaScript API and Places API both enabled via your Google API console.

Pro tips:

  • Get your place ID from here.

  • Remove <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script> from reviews.php if your project already uses jQuery. It's only included in this repo so you can quickly see it working.

Limitations

The Google places API will only allow you to return a maximum of five reviews, and these will always be limited to the reviews Google says are 'Most Relevant' (you can't show the most recent for example).

This is confounded with another problem: If you want to return the five most relevant reviews that have five stars, but one of the reviews among the most relevant only has four stars, then only four reviews will be returned.

License

MIT FTW! (https://opensource.org/licenses/MIT)

google-reviews's People

Contributors

mikeott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

google-reviews's Issues

issue in css

i think need to attached the css along with this repo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.