
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
The Google Reviews gem is a Ruby library that provides a service to fetch reviews from Google based on a place name or place ID. It utilizes the Google Places API to retrieve the reviews and provides a convenient interface for accessing the review data.
Add this line to your Gemfile:
gem 'google_reviews'
And then execute:
$ bundle install
Or install it directly:
$ gem install google_reviews
To fetch reviews based on a place name or place ID, you can use the GoogleReviews::Reviews
class provided by the gem. Here's an example of how to use it:
require 'google_reviews'
api_key = 'YOUR_API_KEY'
place_id = 'PLACE_ID'
reviews = GoogleReviews::Reviews.fetch_reviews_by_place_id(api_key, place_id)
reviews.each do |review|
puts "Author: #{review[:author_name]}"
puts "Rating: #{review[:rating]}"
puts "Review Text: #{review[:text]}"
puts "---"
end
Make sure to replace YOUR_API_KEY
with your actual Google Places API key.
The gem provides custom error classes that you can handle to deal with specific error scenarios. Here are the error classes available:
GoogleReviews::ApiError:
Represents general API-related errors.GoogleReviews::InvalidApiKeyError:
Indicates an invalid API key error.GoogleReviews::InvalidPlaceIdError:
Indicates an invalid place ID error.
You can rescue and handle these errors to provide appropriate error handling in your application.The gem doesn't require any additional configuration. However, it's recommended to configure the locale for translations. By default, the gem uses English (:en
) as the locale. If you want to use a different locale, you can modify the lib/google_reviews/translations.rb file
.
Fork the official repository. Create a topic branch. Implement your feature or bug fix. Add, commit, and push your changes. Submit a pull request.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that google_reviews demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.