Shard Detail

crog v0.1.2

A crystal metaparsing library
crystal crystal-language opengraph open-graph metaparser

Install & Use

Add the following code to your project's shard.yml under:

dependencies to use in production
- OR -
development_dependencies to use in development

  github: rishavs/crog



Crog is a simple Crystal library to parse up the Open Graph meta data for web pages. If you have ever wondered how does sites like Reddit, Facebook etc fetch the relevant images and other metadata from 3rd party sites, this is it.

Special thanks to whose rules i referenced throughout my development.


Add this to your application's shard.yml:

    github: rishavs/crog


require "crog"

To use the library, simple call the Parse method as;

mdata =

the variable here will hold an object with attributes;

            property image :        String | Nil = nil
            property image_width :  Int32 | Nil = nil
            property image_height : Int32 | Nil = nil
            property url :          String | Nil = nil
            property description :  String | Nil = nil
            property title :        String | Nil = nil
            property author :       String | Nil = nil
            property date :         String | Nil = nil
            property logo :         String | Nil = nil
            property tags         = [] of String


A lot of edge cases are not yet picked up. I have left them in the file for future reference.


  1. Fork it (
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request


  • Rishav Rishav Sharan - creator, maintainer