Skip to content

Commit

Permalink
Merge pull request #62 from shaarli/fix/readme
Browse files Browse the repository at this point in the history
README: apply changes from v3.0 and add installation section
  • Loading branch information
ArthurHoaro authored Nov 3, 2020
2 parents 43f924f + cf93c00 commit d2321f3
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,22 @@ This is a community fork of the original
[netscape-bookmark-parser](https://github.com/kafene/netscape-bookmark-parser)
project by [Kafene](http://kafene.org/).

## Installation

Using [Composer](https://getcomposer.org/) ([package](https://packagist.org/packages/shaarli/netscape-bookmark-parser)):

```bash
composer require shaarli/netscape-bookmark-parser
```

## Example
Script:
```php
<?php
require_once 'NetscapeBookmarkParser.php';

require_once 'vendor/autoload.php';

use Shaarli\NetscapeBookmarkParser\NetscapeBookmarkParser;

$parser = new NetscapeBookmarkParser();
$bookmarks = $parser->parseFile('./tests/input/netscape_basic.htm');
Expand All @@ -53,29 +64,41 @@ Output:
array(2) {
[0] =>
array(6) {
'tags' =>
string(14) "private secret"
'uri' =>
string(19) "https://private.tld"
'title' =>
string(12) "Secret stuff"
'note' =>
string(52) "Super-secret stuff you're not supposed to know about"
'tags' =>
array(2) {
[0] =>
string(7) "private"
[1] =>
string(6) "secret"
}
'time' =>
int(971175336)
'pub' =>
int(0)
}
[1] =>
array(6) {
'tags' =>
string(18) "public hello world"
'uri' =>
string(17) "http://public.tld"
'title' =>
string(12) "Public stuff"
'note' =>
string(0) ""
'tags' =>
array(3) {
[0] =>
string(6) "public"
[1] =>
string(5) "hello"
[2] =>
string(5) "world"
}
'time' =>
int(1456433748)
'pub' =>
Expand Down

0 comments on commit d2321f3

Please sign in to comment.