From 2db46371c180c504a2d16e44e4800455f8a5c801 Mon Sep 17 00:00:00 2001 From: Gilles Paquette Date: Thu, 27 Aug 2020 10:05:23 -0400 Subject: [PATCH 1/2] Create FUNDING.yml --- .github/FUNDING.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..8fe5977 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +# github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +# patreon: # Replace with a single Patreon username +# open_collective: # Replace with a single Open Collective username +# ko_fi: # Replace with a single Ko-fi username +tidelift: "packagist/paquettg/php-html-parser" +# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +# liberapay: # Replace with a single Liberapay username +# issuehunt: # Replace with a single IssueHunt username +# otechie: # Replace with a single Otechie username +# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From 590a1b7ea822f31f2739277ef4402e88714ba61a Mon Sep 17 00:00:00 2001 From: Raphael Krut-Landau Date: Wed, 16 Sep 2020 11:31:25 -0400 Subject: [PATCH 2/2] Fixed a few stray typos --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c194c8b..26f6d20 100755 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ This package can be found on [packagist](https://packagist.org/packages/paquettg Usage ----- -You can find many examples of how to use the dom parser and any of its parts (which you will most likely never touch) in the tests directory. The tests are done using PHPUnit and are very small, a few lines each, and are a great place to start. Given that, I'll still be showing a few examples of how the package should be used. The following example is a very simplistic usage of the package. +You can find many examples of how to use the DOM parser and any of its parts (which you will most likely never touch) in the tests directory. The tests are done using PHPUnit and are very small, a few lines each, and are a great place to start. Given that, I'll still be showing a few examples of how the package should be used. The following example is a very simplistic usage of the package. ```php // Assuming you installed from Composer: @@ -36,12 +36,12 @@ $a = $dom->find('a')[0]; echo $a->text; // "click here" ``` -The above will output "click here". Simple no? There are many ways to get the same result from the dome, such as `$dom->getElementsbyTag('a')[0]` or `$dom->find('a', 0)` which can all be found in the tests or in the code itself. +The above will output "click here". Simple, no? There are many ways to get the same result from the DOM, such as `$dom->getElementsbyTag('a')[0]` or `$dom->find('a', 0)`, which can all be found in the tests or in the code itself. Loading Files ------------------ -You may also seamlessly load a file into the dom instead of a string, which is much more convenient and is how I except most developers will be loading the html. The following example is taken from our test and uses the "big.html" file found there. +You may also seamlessly load a file into the DOM instead of a string, which is much more convenient and is how I expect most developers will be loading the HTML. The following example is taken from our test and uses the "big.html" file found there. ```php // Assuming you installed from Composer: @@ -67,12 +67,12 @@ foreach ($contents as $content) } ``` -This example loads the html from big.html, a real page found online, and gets all the content-border classes to process. It also shows a few things you can do with a node but it is not an exhaustive list of methods that a node has available. +This example loads the html from big.html, a real page found online, and gets all the content-border classes to process. It also shows a few things you can do with a node but it is not an exhaustive list of the methods that a node has available. -Loading Url +Loading URLs ---------------- -Loading a url is very similar to the way you would load the html from a file. +Loading a URL is very similar to the way you would load the HTML from a file. ```php // Assuming you installed from Composer: @@ -88,7 +88,7 @@ $dom->loadFromUrl('http://google.com'); $html = $dom->outerHtml; // same result as the first example ``` -loadFromUrl will, by default, use an implementation of the `\Psr\Http\Client\ClientInterface` to do the HTTP request and a default implementation of `\Psr\Http\Message\RequestInterface` to create the body of the request. You can easely implement your own version of either the client or request to use a custom HTTP connection when using loadFromUrl. +loadFromUrl will, by default, use an implementation of the `\Psr\Http\Client\ClientInterface` to do the HTTP request and a default implementation of `\Psr\Http\Message\RequestInterface` to create the body of the request. You can easily implement your own version of either the client or request to use a custom HTTP connection when using loadFromUrl. ```php // Assuming you installed from Composer: @@ -101,7 +101,7 @@ $dom->loadFromUrl('http://google.com', null, new MyClient()); $html = $dom->outerHtml; ``` -As long as the client object implements the interface properly it will use that object to get the content of the url. +As long as the client object implements the interface properly, it will use that object to get the content of the url. Loading Strings ---------------