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-places-data

v0.1.1

Published

A jquery plugin for rendering google places data.

Downloads

5

Readme

google-places

A jQuery plugin to render google places data.

Currently the only only thing that is rendered is a list view of reviews.

Demos

Install

Install with bower.

bower install google-places

Include

Include these files in the head

<link rel="stylesheet" href="bower_components/google-places/google-places.css">
<script src="bower_components/google-places/google-places.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places"></script>

Options

| Required | Description | |----------|-------------| | placeId | google placeId |

| Optional | Type | Description | Default | |----------|----------|-------------|----------| | render | Array | supports reviews, schema, phone, address, hours, staticMap | ['reviews','phone','hours','address,'staticMap'] | min_rating | Int | Only display reviews with a minimum rating (not applicable for schema)| 0 | max_rows | Int | Maximum number of rows to show - 0 for all (not applicable for schema)| 0 | rotateTime | Int | Time in MS to show review before rotating or false for no rotate | false | schema | Object | Options for displaying Schema | see below |

Optional Schema Markup

The schema markup will render something like below:

<span itemscope="" itemtype="http://schema.org/Store">
    <meta itemprop="url" content="http://example.com">
    Google Users Have Rated 
    <span itemprop="name">
        Hostel Fish
    </span> 
    <span itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">
        <span itemprop="ratingValue">5</span>/<span itemprop="bestRating">5</span> 
        based on <span itemprop="ratingCount">5</span> ratings and reviews
    </span>
</span>

| Schema | Type | Description | Default | |----------|----------|-------------|----------| | displayElement | Object | Jquery object or string location where the schema will be appended | '#schema' | | beforeText | String | Text before ratings | 'Google Users Have Rated' | | middleText | String | Text in between ratings | 'based on' | | afterText | String | last text in rating | 'ratings and reviews' | | type | String | schema.org type | 'Store' |

staticMap options

| property | Description | Default | |----------|-------------|----------| | width | map width | 512 | | height | map height | 512 | | zoom | zoom index for map | 17 | | type | map type (roadmap, terrain, satellite, hybrid) | roadmap |

Usage

$("#google-reviews").googlePlaces({
    placeId: 'ChIJa2uI-Nt4bIcR5cvnOxD4cFg'
  , render: ['reviews']
  , min_rating: 4
  , max_rows:5
  , rotateTime:5000
  , schema: {
            displayElement: '#schema' // optional, will use "#schema" by default
          , beforeText: 'Googlers rated'
          , middleText: 'based on'
          , afterText: 'awesome reviewers.'
          , type: 'Hostel'
      }
  , address:{
    displayElement: "#custom-address-id" // optional, will use "#google-address" by default
  }
  , phone:{
    displayElement: "#custom-phone-id" // optional, will use "#google-phone" by default
  }
  , staticMap:{
      displayElement: "#google-static-map" // optional, will use "#google-static-map" by default
  }
  , hours:{
      displayElement: "#google-hours" // optional, will use "#google-hours" by default
  }
});