helgesverre / telefonkatalog
Scrape Norwegian Phone directories with Laravel.
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.8
- illuminate/contracts: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
- livewire/livewire: ^3.0
- spatie/laravel-data: ^3.9
- spatie/laravel-package-tools: ^1.14.0
- symfony/dom-crawler: ^6.4|^7.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.10
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
README
Telefonkatalog: A Package for Norwegian Phone Directory Data Retrieval
Overview
Laravel Telefonkatalog is a package designed for scraping data from phone directories. It returns the extracted data as
a list of Person
objects, making it easier for developers to integrate phone number information into their
applications.
This package is specifically tailored for Norwegian developers looking to incorporate auto-fill functionality into forms on a small scale.
Important Note
This package is not designed for large-scale phone number scraping, as it does not provide any protection or bypass against captchas, anti-botting software, IP-blocking, or rate-limiting. It is exclusively intended for low-traffic web apps requiring occasional auto-fill features in customer/user forms.
Supported Phone Directories
This package currently scrapes data from these phone directories:
Installation
Install the package via Composer:
composer require helgesverre/telefonkatalog
Usage
Import the facade, and call the method, no need to make things complicated.
use HelgeSverre\Telefonkatalog\Facades\Telefonkatalog; // Search by name across all data sources $people = Telefonkatalog::search('helge sverre'); // Find the first result matching a phone number $person = Telefonkatalog::find('95965871');
Return value.
find("number or name")
returns a singlePerson
object.search("number or name")
returns manyPerson
objects as a laravel collection.
Example:
HelgeSverre\Telefonkatalog\Data\Person { +phone: "95965871" +name: "Helge Sverre Hessevik Liseth" +address: "Vognstølen 29" +city: "Bergen" +postalCode: "5096" +url: "https://www.gulesider.no/oppslag/77190505/person" +source: "Gulesider.no" }
License
The MIT License (MIT). Please see License File for more information.