2017 © Pedro Peláez
 

library safebrowsing

Enables querying of Google's SafeBrowsing API

image

ampersa/safebrowsing

Enables querying of Google's SafeBrowsing API

  • Friday, August 11, 2017
  • by ampersa
  • Repository
  • 1 Watchers
  • 0 Stars
  • 532 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 186 % Grown

The README.md

This package enables you to query Google's SafeBrowsing service to determine if a URL exists in their database., (*1)

Installation

Composer, (*2)

$ composer require ampersa/safebrowsing

Usage

Use of the Google SafeBrowsing API (v4) requires a valid API key. Details can be found at https://developers.google.com/safe-browsing/v4/get-started, (*3)

Basic usage, (*4)

use Ampersa\SafeBrowsing\SafeBrowsing;
...

$safebrowsing = new SafeBrowsing(API_KEY);
$result = $safebrowsing->listed('http://ianfette.org');
// Returns: (bool) true

The listed() function accepts a second boolen argument, which when true returns the threat type as reported by SafeBrowsing, (*5)

$safebrowsing = new SafeBrowsing(API_KEY);
$result = $safebrowsing->listed('http://ianfette.org', true);
// Returns: (string) MALWARE

Testing

To run the unit tests within this package, you will need to edit the tests/SafeBrowsingTest.php file and enter a functional SafeBrowsing API key, (*6)

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

The Versions

11/08 2017

dev-master

9999999-dev

Enables querying of Google's SafeBrowsing API

  Sources   Download

MIT

The Requires

 

by Ampersa Ltd

11/08 2017

0.1.4

0.1.4.0

Enables querying of Google's SafeBrowsing API

  Sources   Download

MIT

The Requires

 

by Ampersa Ltd

11/08 2017

0.1.3

0.1.3.0

Enables querying of Google's SafeBrowsing API

  Sources   Download

MIT

The Requires

 

by Ampersa Ltd

08/08 2017

0.1.2

0.1.2.0

Enables querying of Google's SafeBrowsing API

  Sources   Download

MIT

The Requires

 

by Ampersa Ltd

13/04 2017

0.1.1

0.1.1.0

Enables querying of Google's SafeBrowsing API

  Sources   Download

MIT

The Requires

 

by Ampersa Ltd

13/04 2017

0.1

0.1.0.0

  Sources   Download

MIT

The Requires

 

by Ampersa Ltd