Skip to content

jrobertson/ogextractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Reads Twitter and Open Graph metadata from a given URL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages