Skip to content

Commit

Permalink
Change vendor (#4)
Browse files Browse the repository at this point in the history
Change vendor
  • Loading branch information
joskfg authored Dec 11, 2021
1 parent e9b68f5 commit 478f09f
Show file tree
Hide file tree
Showing 41 changed files with 151 additions and 151 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2019 Softonic International S.A.
Copyright 2021 Joskfg International S.A.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -10,4 +10,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Laravel Intelligent Scraper

[![Latest Version](https://img.shields.io/github/release/softonic/laravel-intelligent-scraper.svg?style=flat-square)](https://github.com/softonic/laravel-intelligent-scraper/releases)
[![Latest Version](https://img.shields.io/github/release/joskfg/laravel-intelligent-scraper.svg?style=flat-square)](https://github.com/joskfg/laravel-intelligent-scraper/releases)
[![Software License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/softonic/laravel-intelligent-scraper/master.svg?style=flat-square)](https://travis-ci.org/softonic/laravel-intelligent-scraper)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/softonic/laravel-intelligent-scraper.svg?style=flat-square)](https://scrutinizer-ci.com/g/softonic/laravel-intelligent-scraper/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/softonic/laravel-intelligent-scraper.svg?style=flat-square)](https://scrutinizer-ci.com/g/softonic/laravel-intelligent-scraper)
[![Total Downloads](https://img.shields.io/packagist/dt/softonic/laravel-intelligent-scraper.svg?style=flat-square)](https://packagist.org/packages/softonic/laravel-intelligent-scraper)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/softonic/laravel-intelligent-scraper.svg?style=flat-square)](http://isitmaintained.com/project/softonic/laravel-intelligent-scraper "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/softonic/laravel-intelligent-scraper.svg?style=flat-square)](http://isitmaintained.com/project/softonic/laravel-intelligent-scraper "Percentage of issues still open")
[![Build Status](https://img.shields.io/travis/joskfg/laravel-intelligent-scraper/master.svg?style=flat-square)](https://travis-ci.org/joskfg/laravel-intelligent-scraper)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/joskfg/laravel-intelligent-scraper.svg?style=flat-square)](https://scrutinizer-ci.com/g/joskfg/laravel-intelligent-scraper/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/joskfg/laravel-intelligent-scraper.svg?style=flat-square)](https://scrutinizer-ci.com/g/joskfg/laravel-intelligent-scraper)
[![Total Downloads](https://img.shields.io/packagist/dt/joskfg/laravel-intelligent-scraper.svg?style=flat-square)](https://packagist.org/packages/joskfg/laravel-intelligent-scraper)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/joskfg/laravel-intelligent-scraper.svg?style=flat-square)](http://isitmaintained.com/project/joskfg/laravel-intelligent-scraper "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/joskfg/laravel-intelligent-scraper.svg?style=flat-square)](http://isitmaintained.com/project/joskfg/laravel-intelligent-scraper "Percentage of issues still open")


This packages offers a scraping solution that doesn't require to know the web HTML structure and it is autoconfigured
Expand All @@ -19,12 +19,12 @@ during a long time.
To install, use composer:

```bash
composer require softonic/laravel-intelligent-scraper
composer require joskfg/laravel-intelligent-scraper
```

To publish the scraper config, you can use
```bash
php artisan vendor:publish --provider="Softonic\LaravelIntelligentScraper\ScraperProvider" --tag=config
php artisan vendor:publish --provider="Joskfg\LaravelIntelligentScraper\ScraperProvider" --tag=config
```

The migrations for database are registered in the service provider, so you can execute the migrate command to create the needed tables.
Expand Down Expand Up @@ -77,7 +77,7 @@ the texts, images, metas, etc... that do you want to scrap and label them, so yo
An example from microsoft store could be:
```php
<?php
use Softonic\LaravelIntelligentScraper\Scraper\Models\ScrapedDataset;
use Joskfg\LaravelIntelligentScraper\Scraper\Models\ScrapedDataset;

ScrapedDataset::create([
'url' => 'https://test.c/p/my-objective',
Expand Down Expand Up @@ -120,7 +120,7 @@ The data could be a list of items or a single item.
A basic example could be:
```php
<?php
use Softonic\LaravelIntelligentScraper\Scraper\Models\ScrapedDataset;
use Joskfg\LaravelIntelligentScraper\Scraper\Models\ScrapedDataset;

ScrapedDataset::create([
'url' => 'https://test.c/p/my-objective',
Expand Down Expand Up @@ -148,7 +148,7 @@ Example with `body` field as regexp:

```php
<?php
use Softonic\LaravelIntelligentScraper\Scraper\Models\ScrapedDataset;
use Joskfg\LaravelIntelligentScraper\Scraper\Models\ScrapedDataset;

ScrapedDataset::create([
'url' => 'https://test.c/p/my-objective',
Expand Down Expand Up @@ -177,7 +177,7 @@ text is inside some child element of `<html>`. So define regexp carefully.
After you collected all the Xpath from the HTML, you just need to create the configuration models. They look like:
```php
<?php
use Softonic\LaravelIntelligentScraper\Scraper\Models\Configuration;
use Joskfg\LaravelIntelligentScraper\Scraper\Models\Configuration;

Configuration::create([
'name' => 'title',
Expand Down Expand Up @@ -226,7 +226,7 @@ The scrape will produce a `Scraped` event if all worked as expected.
So attach a listener to that event to receive the data.

```php
/** @var \Softonic\LaravelIntelligentScraper\Scraper\Events\Scraped $event */
/** @var \Joskfg\LaravelIntelligentScraper\Scraper\Events\Scraped $event */
$event->scrapeRequest->url; // Url scraped
$event->scrapeRequest->type; // Request type
$event->scrapeRequest->context; // Context
Expand All @@ -238,7 +238,7 @@ All the output fields are arrays that can contain one or more results.
If the scrape fails a `ScrapeFailed` event is fired with the
scrape request information.
```php
/** @var \Softonic\LaravelIntelligentScraper\Scraper\Events\ScrapeFailed $event */
/** @var \Joskfg\LaravelIntelligentScraper\Scraper\Events\ScrapeFailed $event */
$event->scrapeRequest->url; // Url scraped
$event->scrapeRequest->type; // Request type
$event->scrapeRequest->context; // Context
Expand Down Expand Up @@ -295,7 +295,7 @@ php artisan queue:work --queue=configure # Just one

## Testing

`softonic/laravel-intelligent-scraper` has a [PHPUnit](https://phpunit.de) test suite and a coding style compliance test suite using [PHP CS Fixer](http://cs.sensiolabs.org/).
`joskfg/laravel-intelligent-scraper` has a [PHPUnit](https://phpunit.de) test suite and a coding style compliance test suite using [PHP CS Fixer](http://cs.sensiolabs.org/).

To run the tests, run the following command from the project folder.

Expand All @@ -317,7 +317,7 @@ There are three services that have unique responsibilities and are connected usi

### Scrape

It is fired when the system receive a `\Softonic\LaravelIntelligentScraper\Scraper\Events\ScrapeRequest` event. It
It is fired when the system receive a `\Joskfg\LaravelIntelligentScraper\Scraper\Events\ScrapeRequest` event. It
can be done using our `scrape($url, $type)` helper function.

![Scrape process](./docs/images/scrape_diagram.png "Scrape process")
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "softonic/laravel-intelligent-scraper",
"name": "joskfg/laravel-intelligent-scraper",
"type": "library",
"description" : "Service to scrape a web page easily without knowing their HTML structure.",
"keywords": ["laravel", "scraper", "intelligent", "automatic"],
"license": "Apache-2.0",
"homepage": "https://github.com/softonic/laravel-intelligent-scraper",
"homepage": "https://github.com/joskfg/laravel-intelligent-scraper",
"support": {
"issues": "https://github.com/softonic/laravel-intelligent-scraper/issues"
"issues": "https://github.com/joskfg/laravel-intelligent-scraper/issues"
},
"require": {
"php": ">=7.4",
Expand Down Expand Up @@ -36,7 +36,7 @@
"src/database/factories"
],
"psr-4": {
"Softonic\\LaravelIntelligentScraper\\": "src/"
"Joskfg\\LaravelIntelligentScraper\\": "src/"
}
},
"autoload-dev": {
Expand All @@ -54,7 +54,7 @@
"extra": {
"laravel": {
"providers": [
"Softonic\\LaravelIntelligentScraper\\ScraperProvider"
"Joskfg\\LaravelIntelligentScraper\\ScraperProvider"
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
composer:
volumes:
- ./:/app
image: softonic/composer-rector
image: joskfg/composer-rector
command: composer run test
dev:
volumes:
Expand All @@ -13,5 +13,5 @@ services:
fixcs:
volumes:
- ./:/app
image: softonic/composer-rector
image: joskfg/composer-rector
command: composer run fix-cs
18 changes: 9 additions & 9 deletions src/Scraper/Application/Configurator.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Application;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Application;

use Goutte\Client;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Joskfg\LaravelIntelligentScraper\Scraper\Entities\Field;
use Joskfg\LaravelIntelligentScraper\Scraper\Entities\ScrapedData;
use Joskfg\LaravelIntelligentScraper\Scraper\Events\ConfigurationScraped;
use Joskfg\LaravelIntelligentScraper\Scraper\Events\ScrapeRequest;
use Joskfg\LaravelIntelligentScraper\Scraper\Exceptions\ConfigurationException;
use Joskfg\LaravelIntelligentScraper\Scraper\Models\Configuration;
use Joskfg\LaravelIntelligentScraper\Scraper\Models\ScrapedDataset;
use Joskfg\LaravelIntelligentScraper\Scraper\Repositories\Configuration as ConfigurationRepository;
use JsonException;
use Softonic\LaravelIntelligentScraper\Scraper\Entities\Field;
use Softonic\LaravelIntelligentScraper\Scraper\Entities\ScrapedData;
use Softonic\LaravelIntelligentScraper\Scraper\Events\ConfigurationScraped;
use Softonic\LaravelIntelligentScraper\Scraper\Events\ScrapeRequest;
use Softonic\LaravelIntelligentScraper\Scraper\Exceptions\ConfigurationException;
use Softonic\LaravelIntelligentScraper\Scraper\Models\Configuration;
use Softonic\LaravelIntelligentScraper\Scraper\Models\ScrapedDataset;
use Softonic\LaravelIntelligentScraper\Scraper\Repositories\Configuration as ConfigurationRepository;
use Symfony\Component\DomCrawler\Crawler;
use UnexpectedValueException;

Expand Down
2 changes: 1 addition & 1 deletion src/Scraper/Application/VariantGenerator.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Application;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Application;

use InvalidArgumentException;

Expand Down
2 changes: 1 addition & 1 deletion src/Scraper/Application/XpathBuilder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Application;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Application;

use Illuminate\Support\Facades\Log;
use UnexpectedValueException;
Expand Down
10 changes: 5 additions & 5 deletions src/Scraper/Application/XpathFinder.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Application;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Application;

use Goutte\Client as GoutteClient;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Softonic\LaravelIntelligentScraper\Scraper\Entities\Field;
use Softonic\LaravelIntelligentScraper\Scraper\Entities\ScrapedData;
use Softonic\LaravelIntelligentScraper\Scraper\Exceptions\MissingXpathValueException;
use Softonic\LaravelIntelligentScraper\Scraper\Models\Configuration;
use Joskfg\LaravelIntelligentScraper\Scraper\Entities\Field;
use Joskfg\LaravelIntelligentScraper\Scraper\Entities\ScrapedData;
use Joskfg\LaravelIntelligentScraper\Scraper\Exceptions\MissingXpathValueException;
use Joskfg\LaravelIntelligentScraper\Scraper\Models\Configuration;
use Symfony\Component\DomCrawler\Crawler;
use UnexpectedValueException;

Expand Down
2 changes: 1 addition & 1 deletion src/Scraper/Entities/Field.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Entities;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Entities;

class Field implements \JsonSerializable
{
Expand Down
2 changes: 1 addition & 1 deletion src/Scraper/Entities/ScrapedData.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Entities;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Entities;

class ScrapedData
{
Expand Down
2 changes: 1 addition & 1 deletion src/Scraper/Events/ConfigurationScraped.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Events;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Events;

class ConfigurationScraped extends Scraped
{
Expand Down
2 changes: 1 addition & 1 deletion src/Scraper/Events/InvalidConfiguration.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Events;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Events;

class InvalidConfiguration
{
Expand Down
2 changes: 1 addition & 1 deletion src/Scraper/Events/ScrapeFailed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Events;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Events;

use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
Expand Down
2 changes: 1 addition & 1 deletion src/Scraper/Events/ScrapeRequest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Events;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Events;

use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
Expand Down
4 changes: 2 additions & 2 deletions src/Scraper/Events/Scraped.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Events;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Events;

use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Softonic\LaravelIntelligentScraper\Scraper\Entities\ScrapedData;
use Joskfg\LaravelIntelligentScraper\Scraper\Entities\ScrapedData;

class Scraped
{
Expand Down
2 changes: 1 addition & 1 deletion src/Scraper/Exceptions/ConfigurationException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Exceptions;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Exceptions;

use RuntimeException;

Expand Down
2 changes: 1 addition & 1 deletion src/Scraper/Exceptions/MissingXpathValueException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Exceptions;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Exceptions;

use UnexpectedValueException;

Expand Down
18 changes: 9 additions & 9 deletions src/Scraper/Listeners/ConfigureScraper.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Listeners;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Listeners;

use Exception;
use Illuminate\Contracts\Queue\ShouldQueue;
use Joskfg\LaravelIntelligentScraper\Scraper\Application\XpathFinder;
use Joskfg\LaravelIntelligentScraper\Scraper\Events\InvalidConfiguration;
use Joskfg\LaravelIntelligentScraper\Scraper\Events\Scraped;
use Joskfg\LaravelIntelligentScraper\Scraper\Events\ScrapeFailed;
use Joskfg\LaravelIntelligentScraper\Scraper\Events\ScrapeRequest;
use Joskfg\LaravelIntelligentScraper\Scraper\Exceptions\ConfigurationException;
use Joskfg\LaravelIntelligentScraper\Scraper\Exceptions\MissingXpathValueException;
use Joskfg\LaravelIntelligentScraper\Scraper\Repositories\Configuration;
use JsonException;
use Psr\Log\LoggerInterface;
use Softonic\LaravelIntelligentScraper\Scraper\Application\XpathFinder;
use Softonic\LaravelIntelligentScraper\Scraper\Events\InvalidConfiguration;
use Softonic\LaravelIntelligentScraper\Scraper\Events\Scraped;
use Softonic\LaravelIntelligentScraper\Scraper\Events\ScrapeFailed;
use Softonic\LaravelIntelligentScraper\Scraper\Events\ScrapeRequest;
use Softonic\LaravelIntelligentScraper\Scraper\Exceptions\ConfigurationException;
use Softonic\LaravelIntelligentScraper\Scraper\Exceptions\MissingXpathValueException;
use Softonic\LaravelIntelligentScraper\Scraper\Repositories\Configuration;
use UnexpectedValueException;

class ConfigureScraper implements ShouldQueue
Expand Down
14 changes: 7 additions & 7 deletions src/Scraper/Listeners/Scrape.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Listeners;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Listeners;

use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Collection;
use Joskfg\LaravelIntelligentScraper\Scraper\Application\XpathFinder;
use Joskfg\LaravelIntelligentScraper\Scraper\Events\InvalidConfiguration;
use Joskfg\LaravelIntelligentScraper\Scraper\Events\Scraped;
use Joskfg\LaravelIntelligentScraper\Scraper\Events\ScrapeRequest;
use Joskfg\LaravelIntelligentScraper\Scraper\Exceptions\MissingXpathValueException;
use Joskfg\LaravelIntelligentScraper\Scraper\Repositories\Configuration;
use Psr\Log\LoggerInterface;
use Softonic\LaravelIntelligentScraper\Scraper\Application\XpathFinder;
use Softonic\LaravelIntelligentScraper\Scraper\Events\InvalidConfiguration;
use Softonic\LaravelIntelligentScraper\Scraper\Events\Scraped;
use Softonic\LaravelIntelligentScraper\Scraper\Events\ScrapeRequest;
use Softonic\LaravelIntelligentScraper\Scraper\Exceptions\MissingXpathValueException;
use Softonic\LaravelIntelligentScraper\Scraper\Repositories\Configuration;

class Scrape implements ShouldQueue
{
Expand Down
4 changes: 2 additions & 2 deletions src/Scraper/Listeners/ScrapeFailedListener.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Listeners;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Listeners;

use Exception;
use Illuminate\Contracts\Queue\ShouldQueue;
use Softonic\LaravelIntelligentScraper\Scraper\Events\ScrapeFailed;
use Joskfg\LaravelIntelligentScraper\Scraper\Events\ScrapeFailed;

class ScrapeFailedListener implements ShouldQueue
{
Expand Down
8 changes: 4 additions & 4 deletions src/Scraper/Listeners/ScrapedListener.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Softonic\LaravelIntelligentScraper\Scraper\Listeners;
namespace Joskfg\LaravelIntelligentScraper\Scraper\Listeners;

use Exception;
use Illuminate\Contracts\Queue\ShouldQueue;
use Softonic\LaravelIntelligentScraper\Scraper\Entities\Field;
use Softonic\LaravelIntelligentScraper\Scraper\Events\Scraped;
use Softonic\LaravelIntelligentScraper\Scraper\Events\ScrapeRequest;
use Joskfg\LaravelIntelligentScraper\Scraper\Entities\Field;
use Joskfg\LaravelIntelligentScraper\Scraper\Events\Scraped;
use Joskfg\LaravelIntelligentScraper\Scraper\Events\ScrapeRequest;

class ScrapedListener implements ShouldQueue
{
Expand Down
Loading

0 comments on commit 478f09f

Please sign in to comment.