Skip to content

Commit 431309d

Browse files
committed
Fixes #11, also added language hints to code fences in README
1 parent 81a79fe commit 431309d

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,22 +225,22 @@ In a nutshell, the Crawlbot crawls a set of seed URLs for links (even if a subdo
225225

226226
A joint list of all your crawl / bulk jobs can be fetched via:
227227

228-
```
228+
```php
229229
$diffbot = new Diffbot('my_token');
230230
$jobs = $diffbot->crawl()->call();
231231
```
232232

233233
This returns a collection of all crawl and bulk jobs. Each type is represented by its own class: `JobCrawl` and `JobBulk`. It's important to note that Jobs only contain the information about the job - not the data. To get the data of a job, use the `downloadUrl` method to get the URL to the dataset:
234234

235-
```
235+
```php
236236
$url = $job->downloadUrl("json");
237237
```
238238

239239
### Crawl jobs: Creating a Crawl Job
240240

241241
See inline comments for step by step explanation
242242

243-
```
243+
```php
244244
// Create new diffbot as usual
245245
$diffbot = new Diffbot('my_token');
246246

@@ -266,7 +266,7 @@ dump($job->getDownloadUrl("json")); // outputs download URL to JSON dataset of t
266266

267267
To get data about a job (this will be the data it was configured with - its flags - and not the results!), use the exact same approach as if creating a new one, only without the API and seeds:
268268

269-
```
269+
```php
270270
$diffbot = new Diffbot('my_token');
271271

272272
$crawl = $diffbot->crawl('sitepoint_01');
@@ -282,7 +282,7 @@ While there is no way to alter a crawl job's configuration post creation, you ca
282282

283283
Provided you fetched a `$crawl` instance as in the above section on inspecting, you can do the following:
284284

285-
```
285+
```php
286286
// Force start of a new crawl round manually
287287
$crawl->roundStart();
288288

@@ -301,13 +301,13 @@ Note that it is not necessary to issue a `call()` after these methods.
301301

302302
If you would like to extract the generated API call URL for these instant-call actions, pass in the parameter `false`, like so:
303303

304-
```
304+
```php
305305
$crawl->delete(false);
306306
```
307307

308308
You can then save the URL for your convenience and call `call` when ready to execute (if at all).
309309

310-
```
310+
```php
311311
$url = $crawl->buildUrl();
312312
$url->call();
313313
```

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"extra": {
3636
"branch-alias": {
37-
"dev-master": "0.2-dev"
37+
"dev-master": "0.3-dev"
3838
}
3939
}
40-
}
40+
}

src/Api/Crawl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Crawl
4040
*/
4141
public function __construct($name = null, Api $api = null)
4242
{
43-
if ($name) {
43+
if ($name !== null) {
4444
$this->name = $name;
4545
if ($api) {
4646
$this->setApi($api);

0 commit comments

Comments
 (0)