Coder Social home page Coder Social logo

watzon / opengraph.cr Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 1.0 5 KB

Crystal wrapper for the Open Graph protocol

License: MIT License

Crystal 100.00%
crystal crystal-language opengraph open-graph opengraphprotocol open-graph-protocol opengraph-tags opengraph-data

opengraph.cr's Introduction

opengraph.cr

Crystal wrapper for the Open Graph protocol, allowing you to parse Open Graph meta tags and extract valuable information.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      opengraph:
        github: watzon/opengraph.cr
  2. Run shards install

Usage

require "opengraph"

og = OpenGraph.from_url("css-tricks.com")
# og = OpenGraph.parse("<!-- RAW HTML -->")

puts og.website?
# => true

puts og["title"]?
# => "CSS-Tricks"

puts og["image"]?
# => "https://css-tricks.com/wp-content/uploads/2014/03/css-tricks-star.png"

Contributing

  1. Fork it (https://github.com/watzon/opengraph/fork)
  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

Contributors

opengraph.cr's People

Contributors

watzon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

uu

opengraph.cr's Issues

Unable to shard update opengraph

I am unable to install opengraph as a shard.
It gives me this error.

rishav@Rishav-laptop:/mnt/c/Users/risharan/Documents/GitHub/noir$ shards update
Fetching https://github.com/watzon/opengraph.cr.git
Failed git ls-tree -r --full-tree --name-only v0.1.0 -- shard.yml (). Maybe a commit, branch or file doesn't exist?

I am on Crystal 0.30.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.