{"id":26796403,"url":"https://github.com/peterujah/email-crawl","last_synced_at":"2025-06-28T02:02:10.298Z","repository":{"id":57676765,"uuid":"488914125","full_name":"peterujah/email-crawl","owner":"peterujah","description":" PHP Email Web Crawler. using curl and command line interface to extract emails from website.  ","archived":false,"fork":false,"pushed_at":"2022-05-05T15:59:26.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-28T02:02:00.294Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterujah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-05T09:45:05.000Z","updated_at":"2022-05-05T15:55:31.000Z","dependencies_parsed_at":"2022-09-14T11:51:54.735Z","dependency_job_id":null,"html_url":"https://github.com/peterujah/email-crawl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/peterujah/email-crawl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterujah%2Femail-crawl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterujah%2Femail-crawl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterujah%2Femail-crawl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterujah%2Femail-crawl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterujah","download_url":"https://codeload.github.com/peterujah/email-crawl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterujah%2Femail-crawl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262362035,"owners_count":23299117,"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":"2025-03-29T18:18:36.827Z","updated_at":"2025-06-28T02:02:10.222Z","avatar_url":"https://github.com/peterujah.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# email-crawl\n PHP Email Web Crawler, is a simple and easy to use class that uses curl \u0026 command line interface to extract email address from websites. \n It also has the feature to deep extract email from website link which is found from the initial target website.\n\n## Installation\n\nInstallation is super-easy via Composer:\n```cli\ncomposer require peterujah/email-crawl\n```\n\n## Basic Usage\n\nInitalize email crawl instance\n```php\n$craw = new EmailCrawl(\"https://example.com\", 200);\n```\n\n\nStar email crawling scan\n\n```php\n$craw-\u003ecraw()\n```\n\nGet scanned response and return CrawlResponse instance\n\n```php\n$response = $craw-\u003egetResponse();\n```\n\nGet response emails separate in a new line\n\n```php\n$data = $response-\u003einLine();\n```\n\nGet response emails separate with a comma\n\n```php\n$data = $response-\u003ewithComma();\n```\n\nGet response emails as an array\n```php\n$data = $response-\u003easArray();\n```\n\nPrint response email \n```php\n$response-\u003eprintCommandResult($data);\n```\n\nSave response emails to file. This will save result as json string\n```php\n$response-\u003esave(\"/path/save/craw/\");\n```\n\nSave response emails to file. If string data is passed it will save it, els it will save result as json string\n```php\n$response-\u003esaveAs(\"/path/save/craw/\", $data);\n```\n\nExample\n\nCreate a file name it craw.php, inside the file add this example code.\nWith this example you can run your craw directly from `command line, browser or php shell_exec`.\n\n```php\nerror_reporting(E_ALL);\nini_set('display_errors', '1');\nrequire __DIR__ . '/plugins/autoload.php';\nuse Peterujah\\NanoBlock\\EmailCrawl;\n$target = \"https://example.com/contact\";\n$limit = 50;\nif(!empty($argv[1])){\n    if(filter_var($argv[1], FILTER_VALIDATE_URL)){\n        $target = $argv[1];\n        $limit = $argv[2]??50;\n    }else{\n        $req = unserialize(base64_decode($argv[1]));\n        $target = $req[\"target\"];\n        $limit = $req[\"max\"]??50;\n    }\n}\n$craw = new EmailCrawl($target, $limit);\n$response = $craw-\u003ecraw()-\u003egetResponse();\n$data = $response-\u003einLine();\n$response-\u003eprintCommandResult($data)-\u003esaveAs(__DIR__ . \"/craw/\", $data);\n```\n\nExecute craw through command line interface, run the below command\n```cli\nphp craw.php https://google.com 50\n```\n\nExecute craw through php shell_exec, create a file call exec.php and add below example script.\nNote: change `PHP_SHELL_EXECUTION_PATH` to your php executable path.\nOnce done navigate to https://mycraw.example.com/exec.php\n```php\ndefine(\"PHP_SHELL_EXECUTION_PATH\", \"path/to/php\");\n$crawOptions = array(\n    'target' =\u003e 'https://example.com',\n    'max' =\u003e 50,\n);\n$crawRequest = base64_encode(serialize($crawOptions));\n$crawScript =  __DIR__ . \"/craw.php\";\n$crawLogs =  __DIR__ . \"/craw_logs.log\";\nshell_exec(PHP_SHELL_EXECUTION_PATH . \" \" . $crawScript . \" \" . $crawRequest .\" 'alert' \u003e\u003e \" . $crawLogs . \" 2\u003e\u00261\");\n```\n\n# ATTENTION\n\nIs advisable to run this code in command line interface for be better performance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterujah%2Femail-crawl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterujah%2Femail-crawl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterujah%2Femail-crawl/lists"}