{"id":16939205,"url":"https://github.com/snipe/safebrowsing","last_synced_at":"2025-03-22T12:32:14.570Z","repository":{"id":57054347,"uuid":"62239846","full_name":"snipe/Safebrowsing","owner":"snipe","description":"Laravel 5 package for the Google Safebrowsing API","archived":false,"fork":false,"pushed_at":"2018-10-16T03:11:34.000Z","size":59,"stargazers_count":13,"open_issues_count":2,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T11:11:31.643Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/snipe/safebrowsing","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snipe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-29T16:09:13.000Z","updated_at":"2024-06-20T06:49:49.000Z","dependencies_parsed_at":"2022-08-24T05:21:26.089Z","dependency_job_id":null,"html_url":"https://github.com/snipe/Safebrowsing","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipe%2FSafebrowsing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipe%2FSafebrowsing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipe%2FSafebrowsing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipe%2FSafebrowsing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snipe","download_url":"https://codeload.github.com/snipe/Safebrowsing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959444,"owners_count":20538625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T21:03:59.950Z","updated_at":"2025-03-22T12:32:14.301Z","avatar_url":"https://github.com/snipe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Safebrowsing\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/snipe/safebrowsing?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) [![Build Status](https://travis-ci.org/snipe/Safebrowsing.svg?branch=master)](https://travis-ci.org/snipe/Safebrowsing) [![Latest Stable Version](https://poser.pugx.org/snipe/safebrowsing/v/stable.svg)](https://packagist.org/packages/snipe/safebrowsing) [![Total Downloads](https://poser.pugx.org/snipe/safebrowsing/downloads.svg)](https://packagist.org/packages/snipe/safebrowsing) [![Latest Unstable Version](https://poser.pugx.org/snipe/safebrowsing/v/unstable.svg)](https://packagist.org/packages/snipe/safebrowsing) [![License](https://poser.pugx.org/snipe/safebrowsing/license.svg)](https://packagist.org/packages/snipe/safebrowsing) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/eb21765a140141e6828035a376733a80)](https://www.codacy.com/app/snipe/Safebrowsing?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=snipe/Safebrowsing\u0026amp;utm_campaign=Badge_Grade)\n\nThis is a Laravel 5 package to enable you to easily interface with the Google Safebrowsing API. (Other RBL services are coming.)\n\nRight now it's only using the [Google Safebrowsing Lookup API](https://developers.google.com/safe-browsing/v4/lookup-api) (v4), but I'll be updating it to include the Update API as well. The [old Safebrowsing v3 (non-package) version](http://snipe.net/2014/04/check-user-submitted-urls-for-malware-and-phishing-in-your-application/) of this script has also included Phishtank and several RBLs, but I think the RBLs have changed how they work so that old code doesn't work anymore.\n\n__This package requires that you have [an active Google Safebrowsing API key](https://developers.google.com/safe-browsing/v4/get-started). It absolutely will not work without one.__ It's free to create an API key (although the process is every bit as confusing and convoluted as you would expect from Google).\n\nBear in mind that Google does throttle API usage, so if you have a high-traffic site, you may want to build in a caching layer or something so you don't burn through your requests too quickly. You can keep an eye on your usage through the [Google API console](https://console.developers.google.com/apis/api/safebrowsing.googleapis.com/usage).\n\n__This package is very rough around the edges and probably shouldn't be used for production yet.__ \n\n## Install\n\n### Via Composer\n\n``` bash\n$ composer require snipe/safebrowsing\n```\n\n### Update Your Config\n\n#### For applications using Laravel =\u003c 5.4\n\nOpen `config/app.php` and add:\n\n``` php\nSnipe\\Safebrowsing\\SafebrowsingServiceProvider::class,\n```\n\nto your `providers` array in `config/app.php`, and:\n\n``` php\n'Safebrowsing' =\u003e Snipe\\Safebrowsing\\Facade\\Safebrowsing::class,\n```\n\nto your `aliases` array in `config/app.php`.\n\n### Publish the config\n\n``` bash\nphp artisan vendor:publish\n```\n\n### Set Your Google Safebrowsing API Key\n\nIn your `.env`, add:\n\n``` bash\nGOOGLE_API_KEY=YOUR-ACTUAL-API-KEY\n```\n\nThere are additional options in the config file that relate to what specific types of threats you want to check for, and what platforms you want to check on, but you only really need to worry about that if you want to check *fewer* things, as it's pretty inclusive already.\n\n## Usage\n\n### Using Blade Syntax\n\n``` php\n{{ Safebrowsing::checkSafeBrowsing($urls) }}\n```\n\nor\n\n``` php\n@if (Safebrowsing::isFlagged('http://twitter.com/'))\n    // do something if the url is flagged as suspicious\n@else\n    // hooray - it's not flagged!\n@endif\n```\n\n\n\nwhere `$url` is an array of URLs that you would like to check against the Google Safebrowsing API.\n\n### Using Facades\n``` php\nSafebrowsing::addCheckUrls(['http://ianfette.org']);\nSafebrowsing::addCheckUrls(['http://malware.testing.google.test/testing/malware/']);\nSafebrowsing::execute();\nprint('Status of the third URL is: '.Safebrowsing::isFlagged('http://twitter.com/'));\n```\n\n## Test URLs\n\nHere are some handy test urls you can use while you're experimenting with the system.\n\n- http://www.yahoo.com/ (OK)\n- http://www.google.com/ (OK)\n- http://malware.testing.google.test/testing/malware/ (Malware)\n- http://twitter.com/ (OK)\n- http://ianfette.org (malware)\n- https://github.com/ (OK)\n\n## Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\nFrom the package\n\n``` bash\n`../../../vendor/bin/phpunit`\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email snipe@snipe.net instead of using the issue tracker.\n\n## Credits\n\n- [A. Gianotto][link-author]\n- [All Contributors][link-contributors]\n\n## License\n\nGNU GENERAL PUBLIC LICENSE. Please see [License File](LICENSE.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/snipe/safebrowsing.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/snipe/safebrowsing/master.svg?style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/snipe/safebrowsing.svg?style=flat-square\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/snipe/safebrowsing.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/snipe/safebrowsing.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/snipe/safebrowsing\n[link-travis]: https://travis-ci.org/snipe/safebrowsing\n[link-scrutinizer]: https://scrutinizer-ci.com/g/snipe/safebrowsing/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/snipe/safebrowsing\n[link-downloads]: https://packagist.org/packages/snipe/safebrowsing\n[link-author]: https://github.com/snipe\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnipe%2Fsafebrowsing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnipe%2Fsafebrowsing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnipe%2Fsafebrowsing/lists"}