WebsiteInformation

Gem Version Code Climate MIT License Build Status

Scrape website information that title, meta, page capture, description, ogp and so on.

Installation

Add this line to your application's Gemfile:

gem 'website_information'

And then execute:

$ bundle

Or install it yourself as:

$ gem install website_information

for site capture setting

Please install geckodriverweb driver if you want to use site capture.

  1. Install geckodriver. https://github.com/mozilla/geckodriver/releases or brew install geckodriver
  2. Setting PATH env export PATH=$PATH:/path/to/geckodriver and install firefox

see: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver#Setting_up_the_geckodriver_executable

Usage

scraped_params = WebsiteInformation::Website.new('scraping_url(ex. https://www.google.com)').scraped_params

# ex) get website title
scraped_params.title # => Google

Output

The list of allowed get params values.

  • .title<title> tag value
  • .meta.description<meta name="description" > tag content
  • .meta.keyword<meta name="keyword" > tag content
  • .og.site_name<meta property="og:site_name" > tag content
  • .og.description<meta property="og:description" > tag content
  • .og.url<meta property="og:url" > tag content
  • .og.type<meta property="og:type" > tag content
  • .og.image<meta property="og:image" > tag content
  • .feed<link rel="alternate" > tag href application/atom+xml or application/rss+xml type
  • .sns.facebook — Facebook page plugin (https://developers.facebook.com/docs/plugins/page-plugin/) from data-href
  • .sns.twitter — Twitter embedded timelines (https://dev.twitter.com/web/embedded-timelines/list) from href

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/miraoto/website_information. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the WebsiteInformation project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.