承接 juanparati/copyscape 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

juanparati/copyscape

Composer 安装命令:

composer require juanparati/copyscape

包简介

Copyscape interface for Laravel

README 文档

README

What is it?

A Laravel package that provides a Copyscape interface for their premium API.

Installation

For Laravel 10.x:

    composer require juanparati/copyscape "~10.0"

For Laravel 9.x:

    composer require juanparati/copyscape "~4.0"

For Laravel 8.x:

    composer require juanparati/copyscape "~3.0"

For Laravel 6.x/7.x:

    composer require juanparati/copyscape "~2.0"

For Laravel 5.5 to 5.8:

    composer require juanparati/copyscape "~1.0"

For Laravel 5.5 it is required to register the service provider into the "config/app.php":

    Juanparati\Copyscape\CopyscapeServiceProvider::class,

For Laravel 5.6+ the service provider is automatically registered.

Configuration

    artisan vendor:publish --provider="Juanparati\Copyscape\CopyscapeServiceProvider"                    

Alias

Optionally add the following Alias in your config/app.php (Aliases section):

    'Copyscape' => Juanparati\Copyscape\Facades\CopyscapeClient::class, 

Usage examples

Search against URL

    // Search without full comparison.
    $results = Copyscape::searchURL('http://example.net')->request();
    
    // With optional options
    $search = Copyscape::searchURL('https://en.wikipedia.org/wiki/United_States_Declaration_of_Independence');
    
    $search->setFullComparison(5);  // Set full comparison (0 for disable, 1-10 for full comparison)
    $search->setIgnoreSites(['britannica.com']);
    $search->setSpendLimit(0.1);
    $search->setTestMode(true);
    
    $results = $search->request();

Search against a text

     // Search without full comparison
     $results = Copyscape::searchText('We must, therefore, acquiesce in the necessity, which denounces our Separation, and hold them, as we hold the rest of mankind, Enemies in War, in Peace Friends.')->request();
     
     // With optional options       
     $search = Copyscape::searchText('We must, therefore, acquiesce in the necessity, which denounces our Separation, and hold them, as we hold the rest of mankind, Enemies in War, in Peace Friends.');
     
     $search->setFullComparison(5);  // Set full comparison (0 for disable, 1-10 for full comparison)
     $search->setIgnoreSites(['britannica.com']);
     $search->setSpendLimit(0.1);
     $search->setTestMode(true);
     
     $results = $search->request();

Search types

It's possible to change the possible search type using the "setSearchType" method:

    Copyscape::searchText('Hello Universe')
        ->setSearchType(\Juanparati\Copyscape\Services\SearchService::SEARCH_TYPE_PRIVATE)
        ->request();

The following search types are available:

    \Juanparati\Copyscape\Services\SearchService::SEARCH_TYPE_PUBLIC    // Search against public index
    \Juanparati\Copyscape\Services\SearchService::SEARCH_TYPE_PRIVATE   // Search against private index
    \Juanparati\Copyscape\Services\SearchService::SEARCH_TYPE_BOTH      // Search against public and private indexes   

Add index from URL

In order to use the private index, remember to create a private index from the Copyscape interface

    $results = Copyscape::indexURL('http://example.net', 'my_index_id');

Add index from Text

    $results = Copyscape::indexText('Hello World', 'my_index_id');

Get the credit balance

    $results = Copyscape::getBalance();

统计信息

  • 总下载量: 848
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固