In both cases, you can add an additional parameter to configure various options of how XRay will behave. Below is a list of the options.
In both cases, you can add an additional parameter to configure various options of how XRay will behave. Below is a list of the options.
* `timeout` - The timeout in seconds to wait for any HTTP requests
* `timeout` - The timeout in seconds to wait for any HTTP requests
@ -93,6 +100,39 @@ $parsed = Array
)
)
```
```
### Processing Microformats2 JSON
If you already have a parsed Microformats2 document as an array, you can use a special function to process it into XRay's native format. Make sure you pass the entire parsed document, not just the single item.
$parsed = $xray->process('http://example.com/entry', $mf2); // note the use of `process` not `parse`
Array
(
[data] => Array
(
[type] => entry
[photo] => Array
(
[0] => http://example.com/photo.jpg
)
[content] => Array
(
[text] => Hello World
)
)
[url] => http://example.com/entry
)
```
### Rels
### Rels
You can also use XRay to fetch all the rel values on a page, merging the list of HTTP `Link` headers with rel values with the HTML rel values on the page.
You can also use XRay to fetch all the rel values on a page, merging the list of HTTP `Link` headers with rel values with the HTML rel values on the page.