1- # Laravel OpenGraph
1+ <p align =" center " >
2+ <a href =" https://shweshi.github.io/OpenGraph/ " >
3+ <img alt="Laravel OpenGraph" src="https://user-images.githubusercontent.com/35127382/56821996-695df500-686d-11e9-9c59-c70d0c78c80e.png" />
4+ </a >
5+ </p >
26
3- A Laravel package to fetch Open Graph metadata of a website.
7+ <p align =" center " >
8+ <strong >A Laravel package to fetch Open Graph metadata of a website.</strong >
9+ </p >
410
5- [ ![ Latest Version on Packagist] ( https://img.shields.io/packagist/v/shweshi/OpenGraph.svg?style=flat-square )] ( https://packagist.org/packages/shweshi/OpenGraph )
6- [ ![ Total Downloads] ( https://img.shields.io/packagist/dt/shweshi/OpenGraph.svg?style=flat-square )] ( https://packagist.org/packages/shweshi/OpenGraph )
7- [ ![ Scrutinizer Code Quality] ( https://scrutinizer-ci.com/g/shweshi/OpenGraph/badges/quality-score.png?b=master )] ( https://scrutinizer-ci.com/g/shweshi/OpenGraph/?branch=master )
8- [ ![ StyleCI] ( https://styleci.io/repos/116995669/shield?branch=master )] ( https://styleci.io/repos/116995669 )
9- [ ![ Build Status] ( https://scrutinizer-ci.com/g/shweshi/OpenGraph/badges/build.png?b=master )] ( https://scrutinizer-ci.com/g/shweshi/OpenGraph/build-status/master )
10- [ ![ FOSSA Status] ( https://app.fossa.io/api/projects/git%2Bgithub.com%2Fshweshi%2FOpenGraph.svg?type=shield )] ( https://app.fossa.io/projects/git%2Bgithub.com%2Fshweshi%2FOpenGraph?ref=badge_shield )
11+ <p align =" center " >
12+ <a href =" https://packagist.org/packages/shweshi/OpenGraph " >
13+ <img src="https://img.shields.io/packagist/v/shweshi/OpenGraph.svg?style=flat-square" alt="Latest Version on Packagist">
14+ </a >
1115
12- ## Installation
16+ <a href =" https://packagist.org/packages/shweshi/OpenGraph " >
17+ <img src="https://img.shields.io/packagist/dt/shweshi/OpenGraph.svg?style=flat-square" alt="Total Downloads">
18+ </a >
19+
20+ <a href =" https://scrutinizer-ci.com/g/shweshi/OpenGraph/?branch=master " >
21+ <img src="https://scrutinizer-ci.com/g/shweshi/OpenGraph/badges/quality-score.png?b=master" alt="Scrutinizer Code Quality">
22+ </a >
23+
24+ <a href =" https://styleci.io/repos/116995669 " >
25+ <img src="https://styleci.io/repos/116995669/shield?branch=master" alt="StyleCI">
26+ </a >
27+
28+ <a href =" https://scrutinizer-ci.com/g/shweshi/OpenGraph/build-status/master " >
29+ <img src="https://scrutinizer-ci.com/g/shweshi/OpenGraph/badges/build.png?b=master" alt="Build Status">
30+ </a >
31+
32+ <a href =" https://app.fossa.io/projects/git%2Bgithub.com%2Fshweshi%2FOpenGraph?ref=badge_shield " >
33+ <img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fshweshi%2FOpenGraph.svg?type=shield" alt="FOSSA Status">
34+ </a >
35+ </p >
36+
37+ ## Features
38+
39+ - ** Easily fetch metadata of a url.** Laravel OpenGraph fetch all the metadata of a URL.
40+
41+ - ** Supports twitter metadata.** Laravel OpenGraph supports twitter OG data too.
42+
43+ - ** Verify image URL.** Laravel OpenGraph verifies that the image url in the image metadata is valid or not.
44+
45+ ## How to use Laravel OpenGraph
46+
47+ Article can be found on medium blog: https://hackernoon.com/how-to-fetch-open-graph-metadata-in-laravel-2d5d674904d7
48+
49+ ### Installation
1350
1451Perform the following operations in order to use this package
1552
@@ -42,11 +79,11 @@ If you do not run Laravel 5.5 (or higher), then add the service provider in conf
4279
4380If you do run the package on Laravel 5.5+, package auto-discovery takes care of the magic of adding the service provider.
4481
45- ## Requirements
82+ ### Requirements
4683
4784- You need to install the [ DOM] ( http://www.php.net/en/dom ) extension.
4885
49- ## How to use
86+ ### How to use
5087
5188- After following the above steps,
5289
@@ -55,6 +92,7 @@ If you do run the package on Laravel 5.5+, package auto-discovery takes care of
5592
5693 $data = OpenGraph::fetch("https://unsplash.com/");
5794 ```
95+
5896 this will give you an array like this..
5997
6098 ```
@@ -67,15 +105,15 @@ If you do run the package on Laravel 5.5+, package auto-discovery takes care of
67105 'image:secure_url' => 'https://images.unsplash.com/photo-1542841791-1925b02a2bbb?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjEyMDd9&s=aceabe8a2fd1a273da24e68c21768de0',
68106 )
69107 ```
70-
108+
71109 You can also pass an optional parameter either true or false along with url. When set false it will only fetch basic metadata and in case of true it will fetch all the other optional metadata as well like audio, video, music and twitter metatags as well.
72-
110+
73111 ```
74112 $data = OpenGraph::fetch("https://unsplash.com/", true);
75113 ```
76-
114+
77115 this will give you an array like this..
78-
116+
79117 ```
80118 array (
81119 'charset' => 'UTF8',
@@ -104,23 +142,22 @@ If you do run the package on Laravel 5.5+, package auto-discovery takes care of
104142 )
105143 ```
106144
107- ## Testing
145+ ### Testing
108146
109147 composer test
110148
111- ## Changelog
149+ ### Changelog
112150
113151Please see [ CHANGELOG] ( CHANGELOG.md ) for more information what has changed recently.
114152
115- ## Contributing
153+ ### Contributing
116154
117155Please see [ CONTRIBUTING] ( CONTRIBUTING.md ) and [ CODE OF CONDUCT] ( CODE_OF_CONDUCT.md ) for details.
118156
119- ## License
157+ ### License
120158
121159The MIT License (MIT). Please see [ License File] ( LICENSE ) for more information.
122160
123-
124161[ ![ FOSSA Status] ( https://app.fossa.io/api/projects/git%2Bgithub.com%2Fshweshi%2FOpenGraph.svg?type=large )] ( https://app.fossa.io/projects/git%2Bgithub.com%2Fshweshi%2FOpenGraph?ref=badge_large )
125162
126163### Happy coding!
0 commit comments