Sha256: 61c893933980f1fc2ad70110b0c2c588aa0ef17cc67f9c2aee0e69ed3465efc1
Contents?: true
Size: 1.22 KB
Versions: 1
Compression:
Stored size: 1.22 KB
Contents
# OGP OGP is a minimalist Ruby library that does only one thing: parse Open Graph protocol information from web sites. For more information: http://ogp.me. ## Installation Add this line to your application’s Gemfile: ```ruby gem 'ogp' ``` And then execute: $ bundle Or install it yourself as: $ gem install ogp ## Usage In order to keep OGP very simple, it does not perform any HTTP operations. As such, in this example, [Faraday](https://github.com/lostisland/faraday) is used to achieve this functionality. ```ruby require 'faraday' require 'ogp' response = Faraday.get('http://ogp.me') open_graph = OGP::OpenGraph.new(response.body) open_graph.title # => "Open Graph protocol" open_graph.type # => "website" open_graph.image.url # => "http://ogp.me/logo.png" open_graph.url # => "http://ogp.me/" ``` ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/jcouture/ogp. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ogp-0.1.0 | README.md |