Skip to content

Commit 2964f61

Browse files
committed
Edited readme file
1 parent d45f370 commit 2964f61

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
## What it does
66

7-
This library allows you
7+
This library allows you
88

9-
1. To get url seeds from search engine api (Google)
10-
2. Get code snippets from any web page by crawling url seeds.
9+
1. To get code snippets using search engine api (Google)
10+
2. To get code snippets from any web page by crawling url seeds.
1111

1212
## How to use it
1313

@@ -101,7 +101,7 @@ $urlSeeds = GoogleProvider::create($config)->fetch($query, $meta);
101101
2. Create your new class in the `Snippetify\SnippetSniffer\Providers` folder
102102
3. Each provider implements `Snippetify\SnippetSniffer\Providers\ProviderInterface`
103103
4. Take a look at `Snippetify\SnippetSniffer\Providers\GoogleProvider` to get you helped
104-
5. Your fetch method must return an array of `GuzzleHttp\Psr7\Uri`
104+
5. Your fetch method must return an array of `Psr\Http\Message\UriInterface`
105105
6. Add it in the providers stacks in the `Snippetify\SnippetSniffer\Core.php`
106106
7. Write tests. Take a look at `Snippetify\SnippetSniffer\Tests\Providers\GoogleProviderTest` to get you helped
107107
8. Send a pull request to us
@@ -110,7 +110,7 @@ $urlSeeds = GoogleProvider::create($config)->fetch($query, $meta);
110110

111111
1. Your provider must implement `Snippetify\SnippetSniffer\Providers\ProviderInterface`
112112
2. Take a look at `Snippetify\SnippetSniffer\Providers\GoogleProvider` to get you helped
113-
3. Your fetch method must return an array of `GuzzleHttp\Psr7\Uri`
113+
3. Your fetch method must return an array of `Psr\Http\Message\UriInterface`
114114
4. Pass your new provider in the configuration parameter or use the `addProvider` method
115115

116116
```php
@@ -119,15 +119,15 @@ use Snippetify\SnippetSniffer\SnippetSniffer;
119119
// Use Configurations
120120
$config = [
121121
"providers" => [
122-
"provider_name" => "ProviderClass::class",
123-
"provider_2_name" => "Provider2Class::class" // You can add as many as you want
122+
"provider_name" => ProviderClass::class,
123+
"provider_2_name" => Provider2Class::class // You can add as many as you want
124124
]
125125
];
126126

127127
// Or use addProvider method as follow
128128
SnippetSniffer::create(...)
129-
->addProvider('provider_name', 'ProviderClass::class')
130-
->addProvider('provider_2_name', 'Provider2Class::class') // You can add as many as you want
129+
->addProvider('provider_name', ProviderClass::class)
130+
->addProvider('provider_2_name', Provider2Class::class) // You can add as many as you want
131131
...
132132
```
133133

@@ -189,21 +189,21 @@ use Snippetify\SnippetSniffer\SnippetSniffer;
189189
// Configurations
190190
$config = [
191191
"scrapers" => [
192-
"scraper_name" => "ScraperClass::class",
193-
"scraper_2_name" => "Scraper2Class::class" // You can add as many as you want
192+
"scraper_name" => ScraperClass::class,
193+
"scraper_2_name" => Scraper2Class::class // You can add as many as you want
194194
]
195195
];
196196

197197
// Or use addProvider method as follow
198198
SnippetSniffer::create(...)
199-
->addScraper('scraper_name', 'ScraperClass::class')
200-
->addScraper('scraper_2_name', 'Scraper2Class::class') // You can add as many as you want
199+
->addScraper('scraper_name', ScraperClass::class)
200+
->addScraper('scraper_2_name', Scraper2Class::class) // You can add as many as you want
201201
...
202202
```
203203

204-
### Sniptbot
204+
### Snippet crawler
205205

206-
Sniptbot allows you to extract all snippets from a website by crawling it.
206+
Snippet crawler allows you to extract all snippets from a website by crawling it.
207207

208208
```php
209209
use Snippetify\SnippetSniffer\WebCrawler;
@@ -215,14 +215,13 @@ $config = [...];
215215
$snippets = WebCrawler::create($config)->fetch(['your uri']);
216216
```
217217

218-
219-
220218
#### Configuration reference
221219

222220
```php
223221
$config = [
224222
// Required
225223
// Search engine api configuration keys
224+
// https://developers.google.com/custom-search/v1/introduction
226225
'provider' => [
227226
"cx" => "your google Search engine ID",
228227
"key" => "your google API key"

0 commit comments

Comments
 (0)