# Ogp

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ogp`. To experiment with that code, run `bin/console` for an interactive prompt.

TODO: Delete this and the text above, and describe your gem

## 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

TODO: Write usage instructions here

## Development

After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## 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).


# 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

To keep it very simple, OGP does not perform any HTTP operations. As such, in this example, we use [Faraday](https://github.com/lostisland/faraday) 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).


Add valuable information in the readme file.
Add valuable information in the readme file.
