0.0
The project is in a healthy, maintained state
Reads Twitter and Open Graph metadata from a given URL.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Project Readme

Introducing the OgExtractor gem

require 'ogextractor'

url = 'https://www.bbc.co.uk/news/uk-politics-56605598'
oge = OgExtractor.new(url)

oge.title #=> "Coronavirus: Dozens of MPs criticise 'divisive...
oge.description #=> "Ministers are accused of "creeping a...
oge.type  #=> "article" 
oge.image #=> "https://ichef.bbci.co.uk/news/1024/branded_news...
oge.url   #=> "https://www.bbc.com/news/uk-politics-56605598" 

oge.to_h

output:

{:card=>"summary_large_image",
 :title=>"Coronavirus: Dozens of MPs criticise 'divisive' Covid passports",
 :img=>"https://ichef.bbci.co.uk/news/1024/branded_news/BB4F/production/_117815974_063818791-1.jpg",
 :desc=>
  "Ministers are accused of "creeping authoritarianism" amid reports that the passports will be trialled.",
 :url=>"https://www.bbc.com/news/uk-politics-56605598"} 

Resources

ogextractor opengraph twitter metadata socialmedia parser extractor