
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
OpengraphParser is a simple Ruby library for parsing Open Graph protocol information from a website. Learn more about the protocol at: http://ogp.me
gem install opengraph_parser
or add to Gemfile
gem "opengraph_parser"
og = OpenGraph.new("http://ogp.me")
og.title # => "Open Graph protocol"
og.type # => "website"
og.url # => "http://ogp.me/"
og.description # => "The Open Graph protocol enables any web page to become a rich object in a social graph."
og.images # => ["http://ogp.me/logo.png"]
You can also get other Open Graph metadata as:
og.metadata # => {"og:image:type"=>"image/png", "og:image:width"=>"300", "og:image:height"=>"300"}
og = OpenGraph.new(html_string)
In some cases you may need to change fields in HTTP request header for an URL
og = OpenGraph.new("http://opg.me", { :headers => {'User-Agent' => 'Custom User Agent'} })
If you try to parse Open Graph information for a website that doesn’t have any Open Graph metadata, the library will try to find other information in the website as the following rules:
<title>
for title<meta name="description">
for description<link rel="image_src">
or all <img>
tags for imagesYou can disable this fallback lookup by passing false to init method:
og = OpenGraph.new("http://ogp.me", false)
Copyright (c) 2013 Huy Ha. See LICENSE.txt for further details.
FAQs
Unknown package
We found that opengraph_parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.