Skip to content

Commit a99b9fb

Browse files
committed
Updated - readme file
1 parent 8655178 commit a99b9fb

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"authors": [
88
{
99
"name": "Andrei Igna",
10-
"email": "andrei.igna@layered.studio"
10+
"email": "andrei@laye.red"
1111
}
1212
],
1313
"require": {

readme.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
**Page Meta** is a PHP library than can retrieve detailed info on any URL from the internet!
55
It uses data from HTML meta tags and [OpenGraph](http://ogp.me/) with fallback to detailed HTML scraping.
66

7-
## Use cases
7+
## Highlights
8+
- Works for any valid URL on the internet!
9+
- Follows page redirects
10+
- Uses all scraping methods available: HTML tags, OpenGraph, Schema data
11+
12+
## Potention use cases
813
* Display Info Cards for links in a article
914
* Rich preview for links in messaging apps
1015
* Extract info from a user-submitted URL
@@ -20,12 +25,15 @@ $ composer require layered/page-meta
2025

2126
#### Usage
2227

23-
Create a `UrlPreview` instance, then call `loadUrl($url)` method with desired URL as first argument. Preview data is retrieved with `get($section)` or `getAll()` methods:
28+
Create a `UrlPreview` instance, then call `loadUrl($url)` method with your URL as first argument. Preview data is retrieved with `get($section)` or `getAll()` methods:
2429
```
2530
require 'vendor/autoload.php';
2631
2732
$preview = new Layered\PageMeta\UrlPreview;
28-
$preview->loadUrl('https://www.instagram.com/p/BbRyo_Kjqt1/')->getAll();
33+
$preview->loadUrl('https://www.instagram.com/p/BbRyo_Kjqt1/');
34+
35+
$allPageData = $preview->getAll(); // contains all scraped data
36+
$siteInfo = $preview->get('site'); // get general info about the website
2937
```
3038

3139
#### Returned data
@@ -78,12 +86,12 @@ Returned data will be an `Array` with following format:
7886
#### `__construct(array $headers)`
7987
Start the UrlPreview instance. Pass extra headers to send when requesting the page URL
8088

81-
**Return:** UrlPreview instance
89+
**Returns:** UrlPreview instance
8290

8391
#### `loadUrl(string $url)`
8492
Load and start the scrape process for any valid URL
8593

86-
**Return:** UrlPreview instance
94+
**Returns:** UrlPreview instance
8795

8896
#### `getAll()`
8997
Get all data scraped from page

src/UrlPreview.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* UrlPreview
1212
*
13-
* @author Andrei Igna <andrei.igna@layered.studio>
13+
* @author Andrei Igna <andrei@laye.red>
1414
*/
1515
class UrlPreview {
1616

0 commit comments

Comments
 (0)