Skip to content

Commit

Permalink
Merge pull request #1 from hashbangcode/request_options
Browse files Browse the repository at this point in the history
Request options
  • Loading branch information
philipnorton42 authored Feb 12, 2024
2 parents fbf8cf5 + 94be000 commit 8923e83
Show file tree
Hide file tree
Showing 16 changed files with 906 additions and 566 deletions.
39 changes: 32 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,42 @@ For the coverage report you need to add the following to your xdebug.ini configu
xdebug.mode=coverage
```

## Example Using Classes

To extract the classes out of this project to use independently do the following.

```php
<?php

use Hashbangcode\SitemapChecker\Crawler\GuzzlePromiseCrawler;

require __DIR__ . '/vendor/autoload.php';

// Set the engine up.
$client = new \GuzzleHttp\Client();
$crawler = new \Hashbangcode\SitemapChecker\Crawler\GuzzleCrawler();
$crawler->setEngine($client);

// Create a URL.
$url = new \Hashbangcode\SitemapChecker\Url\Url('https://www.hashbangcode.com/');

// Crawl a single URL.
$result = $crawler->processUrl($url);

// Print result object.
print_r($result);

```

## To Do

There's still lots to do.

- Add exclusion rules to prevent certain URLs from being checked.
- Add limits to visit only a certain amount of links.
- Add ability to add basic authentication.
- Better results presenting. Render as HTML, XML, json etc.
- Add a way to auto-download the chrome download.
- Look at using a database.
- Add a way to auto-download the Chrome binary.
- Look into using a database or message queue.
- Add Docker container to wrap application.
- Batching processing of urls.
- Batching processing of urls (i.e. don't do everything in one go).
- Pick better name for application.
- Pull out the links from within the content of the site.
- Add ability to add session cookies for authenticated spidering.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"symfony/config": "^6.2",
"symfony/dependency-injection": "^6.2",
"symfony/yaml": "^6.2",
"guzzlehttp/promises": "^1.5",
"guzzlehttp/promises": "^2.0",
"symfony/framework-bundle": "^6.2",
"chrome-php/chrome": "^1.8"
},
Expand Down
Loading

0 comments on commit 8923e83

Please sign in to comment.