Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hedii/php-crawler
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.4
Choose a base ref
...
head repository: hedii/php-crawler
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Mar 12, 2016

  1. add index to url name row

    hedii committed Mar 12, 2016
    Copy the full SHA
    57c4a2d View commit details
  2. minor css fixes

    hedii committed Mar 12, 2016
    Copy the full SHA
    9f5b738 View commit details
  3. Update .env

    hedii committed Mar 12, 2016
    Copy the full SHA
    894a64c View commit details
  4. Update .env.example

    hedii committed Mar 12, 2016
    Copy the full SHA
    0a16953 View commit details
  5. Update README.md

    hedii committed Mar 12, 2016
    Copy the full SHA
    5f947f8 View commit details

Commits on Jun 12, 2016

  1. Update README.md

    hedii authored Jun 12, 2016
    Copy the full SHA
    44688bc View commit details

Commits on Oct 20, 2016

  1. fix where statement

    hedii committed Oct 20, 2016
    Copy the full SHA
    add05bc View commit details

Commits on Nov 26, 2017

  1. Fresh laravel 5.5 install

    hedii committed Nov 26, 2017
    Copy the full SHA
    429088b View commit details
  2. Remove .env from git

    hedii committed Nov 26, 2017
    Copy the full SHA
    04c401e View commit details
  3. Setup new app

    hedii committed Nov 26, 2017
    Copy the full SHA
    4690a2f View commit details

Commits on Jan 21, 2018

  1. Reset

    hedii committed Jan 21, 2018
    Copy the full SHA
    6bffd7b View commit details
  2. Remove .env from repo

    hedii committed Jan 21, 2018
    Copy the full SHA
    f943c4f View commit details
  3. New version

    hedii committed Jan 21, 2018
    Copy the full SHA
    067dd29 View commit details
  4. Delete .env

    hedii authored Jan 21, 2018
    Copy the full SHA
    1c5cb53 View commit details
  5. Update composer

    hedii committed Jan 21, 2018
    Copy the full SHA
    04ca38e View commit details
  6. Update build command

    hedii committed Jan 21, 2018
    Copy the full SHA
    dcd2901 View commit details
  7. Add passport migrations

    hedii committed Jan 21, 2018
    Copy the full SHA
    629d7df View commit details
  8. Update README.md

    hedii authored Jan 21, 2018
    Copy the full SHA
    4901b83 View commit details
  9. Create LICENSE

    hedii authored Jan 21, 2018
    Copy the full SHA
    be7087b View commit details
  10. Update README.md

    hedii authored Jan 21, 2018
    Copy the full SHA
    53b1ae6 View commit details
  11. Add .travis.yml

    hedii committed Jan 21, 2018
    Copy the full SHA
    68b75d5 View commit details
  12. Update travis

    hedii committed Jan 21, 2018
    Copy the full SHA
    7b70685 View commit details
  13. Update travis

    hedii committed Jan 21, 2018
    Copy the full SHA
    3fcc9bb View commit details
  14. Update travis

    hedii committed Jan 21, 2018
    Copy the full SHA
    3441bf5 View commit details
  15. Update travis

    hedii committed Jan 21, 2018
    Copy the full SHA
    6275023 View commit details
  16. Update travis

    hedii committed Jan 21, 2018
    Copy the full SHA
    8ab58a3 View commit details
  17. Update travis

    hedii committed Jan 21, 2018
    Copy the full SHA
    261bb64 View commit details
  18. Update Build command

    hedii committed Jan 21, 2018
    Copy the full SHA
    f686c9d View commit details
  19. Update travis

    hedii committed Jan 21, 2018
    Copy the full SHA
    b4f0680 View commit details
  20. Update Build command

    hedii committed Jan 21, 2018
    Copy the full SHA
    687a4a7 View commit details
  21. Update README.md

    hedii authored Jan 21, 2018
    Copy the full SHA
    db6438c View commit details
  22. Update README.md

    hedii authored Jan 21, 2018
    Copy the full SHA
    b292974 View commit details

Commits on Feb 17, 2018

  1. Upgrade Laravel to 5.6

    hedii committed Feb 17, 2018
    Copy the full SHA
    0c2b3cb View commit details
  2. Merge pull request #33 from hedii/laravel56

    Upgrade Laravel to 5.6
    hedii authored Feb 17, 2018
    Copy the full SHA
    44bb5be View commit details

Commits on Jan 24, 2019

  1. Upgrade to Laravel 5.7

    Close #35  (outdated laravel passport version)
    hedii committed Jan 24, 2019
    Copy the full SHA
    91764a7 View commit details

Commits on May 20, 2021

  1. Update README.md

    hedii authored May 20, 2021
    Copy the full SHA
    9de07a7 View commit details
Showing with 18,699 additions and 4,339 deletions.
  1. +0 −23 .env
  2. +21 −5 .env.example
  3. +10 −0 .env.travis
  4. +3 −1 .gitattributes
  5. +12 −5 .gitignore
  6. +11 −0 .travis.yml
  7. +21 −0 LICENSE
  8. +57 −49 README.md
  9. +60 −0 app/Console/Commands/BuildCommand.php
  10. +42 −0 app/Console/Commands/CrawlCommand.php
  11. +0 −62 app/Console/Commands/Crawler/Build.php
  12. +0 −64 app/Console/Commands/Crawler/Crawl.php
  13. +0 −33 app/Console/Commands/Inspire.php
  14. +14 −2 app/Console/Kernel.php
  15. +0 −257 app/Crawler/Crawler.php
  16. +42 −0 app/Email.php
  17. +0 −8 app/Events/Event.php
  18. +18 −15 app/Exceptions/Handler.php
  19. +4 −173 app/Http/Controllers/Api/ApiController.php
  20. +0 −53 app/Http/Controllers/Api/ResourceController.php
  21. +22 −120 app/Http/Controllers/Api/SearchController.php
  22. +33 −0 app/Http/Controllers/Api/SearchStatisticsController.php
  23. +0 −66 app/Http/Controllers/Api/UrlController.php
  24. +20 −10 app/Http/Controllers/Api/UserController.php
  25. +39 −0 app/Http/Controllers/Api/UserSearchController.php
  26. +32 −0 app/Http/Controllers/Auth/ForgotPasswordController.php
  27. +41 −0 app/Http/Controllers/Auth/LoginController.php
  28. +18 −17 app/Http/Controllers/Auth/{AuthController.php → RegisterController.php}
  29. +11 −2 app/Http/Controllers/Auth/{PasswordController.php → ResetPasswordController.php}
  30. +18 −0 app/Http/Controllers/DashboardController.php
  31. +18 −0 app/Http/Controllers/HomeController.php
  32. +0 −91 app/Http/Controllers/ResourceController.php
  33. +0 −164 app/Http/Controllers/SearchController.php
  34. +29 −0 app/Http/Controllers/SearchEmailController.php
  35. +31 −0 app/Http/Controllers/UserEmailController.php
  36. +11 −1 app/Http/Kernel.php
  37. +0 −30 app/Http/Middleware/Authenticate.php
  38. +2 −2 app/Http/Middleware/EncryptCookies.php
  39. +1 −1 app/Http/Middleware/RedirectIfAuthenticated.php
  40. +18 −0 app/Http/Middleware/TrimStrings.php
  41. +23 −0 app/Http/Middleware/TrustProxies.php
  42. +2 −2 app/Http/Middleware/VerifyCsrfToken.php
  43. +0 −10 app/Http/Requests/Request.php
  44. +36 −0 app/Http/Requests/SearchRequest.php
  45. +39 −0 app/Http/Requests/UserRequest.php
  46. +31 −0 app/Http/Requests/UserSearchRequest.php
  47. +19 −0 app/Http/Resources/SearchCollection.php
  48. +19 −0 app/Http/Resources/SearchResource.php
  49. +19 −0 app/Http/Resources/UserResource.php
  50. +0 −65 app/Http/routes.php
  51. +52 −0 app/Jobs/CrawlJob.php
  52. +0 −21 app/Jobs/Job.php
  53. 0 app/Policies/.gitkeep
  54. +59 −0 app/Policies/SearchPolicy.php
  55. +35 −0 app/Policies/UserPolicy.php
  56. +11 −7 app/Providers/AuthServiceProvider.php
  57. +21 −0 app/Providers/BroadcastServiceProvider.php
  58. +0 −32 app/Providers/CrawlerServiceProvider.php
  59. +5 −6 app/Providers/EventServiceProvider.php
  60. +40 −10 app/Providers/RouteServiceProvider.php
  61. +0 −45 app/Resource.php
  62. +44 −60 app/Search.php
  63. +230 −0 app/Services/Crawler/Crawler.php
  64. +0 −33 app/Transformers/ResourceTransformer.php
  65. +0 −74 app/Transformers/SearchTransformer.php
  66. +0 −32 app/Transformers/UrlTransformer.php
  67. +0 −31 app/Transformers/UserTransformer.php
  68. +34 −14 app/Url.php
  69. +17 −22 app/User.php
  70. +27 −0 app/helpers.php
  71. +4 −2 artisan
  72. +0 −34 bootstrap/autoload.php
  73. 0 bootstrap/cache/.gitignore
  74. +44 −28 composer.json
  75. +4,501 −1,320 composer.lock
  76. +54 −45 config/app.php
  77. +1 −6 config/auth.php
  78. +11 −4 config/broadcasting.php
  79. +17 −5 config/cache.php
  80. +0 −35 config/compile.php
  81. +43 −40 config/database.php
  82. +12 −10 config/filesystems.php
  83. +52 −0 config/hashing.php
  84. +93 −0 config/logging.php
  85. +37 −12 config/mail.php
  86. +22 −22 config/queue.php
  87. +14 −9 config/services.php
  88. +51 −5 config/session.php
  89. +5 −2 config/view.php
  90. +14 −0 database/factories/EmailFactory.php
  91. +0 −21 database/factories/ModelFactory.php
  92. +24 −0 database/factories/SearchFactory.php
  93. +18 −0 database/factories/UrlFactory.php
  94. +24 −0 database/factories/UserFactory.php
  95. 0 database/migrations/.gitkeep
  96. +3 −2 database/migrations/2014_10_12_000000_create_users_table.php
  97. +4 −3 database/migrations/2014_10_12_100000_create_password_resets_table.php
  98. +0 −35 database/migrations/2016_02_19_081708_create_searches_table.php
  99. +0 −33 database/migrations/2016_02_19_085348_add_foreign_keys_to_resources_table.php
  100. +0 −33 database/migrations/2016_02_19_085532_add_foreign_keys_to_urls_table.php
  101. +0 −31 database/migrations/2016_02_19_085640_add_foreign_keys_to_searches_table.php
  102. +35 −0 database/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php
  103. +37 −0 database/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php
  104. +33 −0 database/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php
  105. +38 −0 database/migrations/2016_06_01_000004_create_oauth_clients_table.php
  106. +6 −7 ...09_create_resources_table.php → 2016_06_01_000005_create_oauth_personal_access_clients_table.php}
  107. +35 −0 database/migrations/2018_01_19_203819_create_sessions_table.php
  108. +47 −0 database/migrations/2018_01_19_205205_create_searches_table.php
  109. +11 −5 ...se/migrations/{2016_02_19_080933_create_urls_table.php → 2018_01_19_212151_create_urls_table.php}
  110. +38 −0 database/migrations/2018_01_19_213937_create_emails_table.php
  111. 0 database/seeds/.gitkeep
  112. +1 −1 database/seeds/DatabaseSeeder.php
  113. +20 −0 database/seeds/UsersTableSeeder.php
  114. +0 −20 gulpfile.js
  115. +9,519 −0 package-lock.json
  116. +26 −12 package.json
  117. +11 −5 phpunit.xml
  118. +7 −6 public/.htaccess
  119. 0 public/build/css/app-d41d8cd98f.css
  120. +0 −1 public/build/css/app.css.map
  121. +0 −5 public/build/js/app-8e71bf6f18.js
  122. +0 −1 public/build/js/app.js.map
  123. +0 −4 public/build/rev-manifest.json
  124. +6 −0 public/css/app.css
  125. +0 −1 public/css/app.css.map
  126. +5 −3 public/index.php
  127. +1 −5 public/js/app.js
  128. +0 −1 public/js/app.js.map
  129. +4 −0 public/mix-manifest.json
  130. +1 −0 public/svg/403.svg
  131. +1 −0 public/svg/404.svg
  132. +1 −0 public/svg/500.svg
  133. +1 −0 public/svg/503.svg
  134. +0 −23 public/web.config
  135. +0 −46 resources/assets/js/app.js
  136. +0 −44 resources/assets/js/components/SearchActionsButtons.vue
  137. +0 −59 resources/assets/js/components/SearchCreate.vue
  138. +0 −102 resources/assets/js/components/SearchIndex.vue
  139. +0 −99 resources/assets/js/components/SearchShow.vue
  140. +0 −2 resources/assets/sass/app.scss
  141. +9 −0 resources/js/api/client.js
  142. +11 −0 resources/js/api/index.js
  143. +6 −0 resources/js/api/search_statistics.js
  144. +8 −0 resources/js/api/searches.js
  145. +7 −0 resources/js/api/user_searches.js
  146. +7 −0 resources/js/api/users.js
  147. +12 −0 resources/js/app.js
  148. +52 −0 resources/js/components/ConfirmDeleteModal.vue
  149. +15 −0 resources/js/components/Dashboard.vue
  150. +70 −0 resources/js/components/Pagination.vue
  151. +31 −0 resources/js/components/ProgressBar.vue
  152. +61 −0 resources/js/components/forms/FormCheckbox.vue
  153. +59 −0 resources/js/components/forms/FormInput.vue
  154. +37 −0 resources/js/components/forms/SearchForm.vue
  155. +47 −0 resources/js/components/forms/UserForm.vue
  156. +78 −0 resources/js/components/search/SearchCreate.vue
  157. +159 −0 resources/js/components/search/SearchIndex.vue
  158. +119 −0 resources/js/components/search/SearchShow.vue
  159. +68 −0 resources/js/components/user/UserEdit.vue
  160. +15 −0 resources/js/helpers/route.js
  161. +10 −0 resources/js/helpers/vue-filters.js
  162. +26 −0 resources/js/router/index.js
  163. +29 −0 resources/js/router/routes.js
  164. +1 −1 resources/lang/en/pagination.php
  165. +12 −1 resources/lang/en/validation.php
  166. +3 −0 resources/sass/_general.scss
  167. +13 −0 resources/sass/_transitions.scss
  168. +3 −0 resources/sass/app.scss
  169. +0 −1 resources/views/auth/emails/password.blade.php
  170. +60 −41 resources/views/auth/login.blade.php
  171. +34 −30 resources/views/auth/passwords/email.blade.php
  172. +55 −45 resources/views/auth/passwords/reset.blade.php
  173. +66 −56 resources/views/auth/register.blade.php
  174. +40 −0 resources/views/dashboard.blade.php
  175. +0 −47 resources/views/errors/503.blade.php
  176. +2 −8 resources/views/home.blade.php
  177. +13 −81 resources/views/layouts/app.blade.php
  178. +13 −0 resources/views/partials/footer.blade.php
  179. +61 −0 resources/views/partials/header.blade.php
  180. +3 −0 resources/views/partials/main.blade.php
  181. +0 −20 resources/views/searches/create.blade.php
  182. +0 −23 resources/views/searches/index.blade.php
  183. +0 −20 resources/views/searches/show.blade.php
  184. 0 resources/views/vendor/.gitkeep
  185. +0 −17 resources/views/welcome.blade.php
  186. +25 −0 routes/api.php
  187. +12 −0 routes/channels.php
  188. +12 −0 routes/console.php
  189. +22 −0 routes/web.php
  190. +1 −1 server.php
  191. 0 storage/app/.gitignore
  192. 0 storage/app/public/.gitignore
  193. +1 −0 storage/framework/.gitignore
  194. +2 −1 storage/framework/cache/.gitignore
  195. 0 app/Listeners/.gitkeep → storage/framework/cache/data/.gitignore
  196. 0 storage/framework/sessions/.gitignore
  197. +2 −0 storage/framework/testing/.gitignore
  198. 0 storage/framework/views/.gitignore
  199. 0 storage/logs/.gitignore
  200. +22 −0 tests/CreatesApplication.php
  201. +0 −19 tests/ExampleTest.php
  202. +51 −0 tests/Feature/Api/Search/DestroySearchTest.php
  203. +64 −0 tests/Feature/Api/Search/ShowSearchStatisticsTest.php
  204. +52 −0 tests/Feature/Api/Search/ShowSearchTest.php
  205. +116 −0 tests/Feature/Api/Search/UpdateSearchTest.php
  206. +36 −0 tests/Feature/Api/User/MeUserTest.php
  207. +53 −0 tests/Feature/Api/User/UpdateUserTest.php
  208. +54 −0 tests/Feature/Api/UserSearch/IndexUserSearchTest.php
  209. +134 −0 tests/Feature/Api/UserSearch/StoreUserSearchTest.php
  210. +64 −0 tests/Feature/SearchEmailTest.php
  211. +63 −0 tests/Feature/UserEmailTest.php
  212. +5 −20 tests/TestCase.php
  213. +29 −0 tests/Unit/EmailTest.php
  214. +100 −0 tests/Unit/SearchTest.php
  215. +50 −0 tests/Unit/UrlTest.php
  216. +39 −0 tests/Unit/UserTest.php
  217. +21 −0 webpack.mix.js
23 changes: 0 additions & 23 deletions .env

This file was deleted.

26 changes: 21 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,23 +1,39 @@
APP_NAME=Crawler
APP_ENV=local
APP_DEBUG=true
APP_KEY=
APP_DEBUG=true
APP_URL=http://crawler.localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=php-crawler
DB_PORT=3306
DB_DATABASE=crawler
DB_USERNAME=root
DB_PASSWORD=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
QUEUE_DRIVER=sync
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
10 changes: 10 additions & 0 deletions .env.travis
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
APP_NAME=Crawler
APP_ENV=testing
APP_KEY=

DB_CONNECTION=sqlite
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
DB_CONNECTION=sqlite
DB_DATABASE=":memory:"
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* text=auto
*.css linguist-vendored
*.less linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
17 changes: 12 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
/vendor
/node_modules
/public/hot
/public/storage
Homestead.yaml
/storage/*.key
/vendor
/.idea
/.vagrant
Homestead.json

.DS_Store
.idea/
Homestead.yaml
npm-debug.log
yarn-error.log
.env
/.phpstorm.meta.php
/_ide_helper.php
/_ide_helper_models.php
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: php
php:
- 7.2
before_script:
- cp .env.travis .env
- composer self-update
- composer install --no-interaction
- php artisan key:generate
- php artisan crawler:build
script:
- ./vendor/bin/phpunit
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 hedii

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
106 changes: 57 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,83 @@
# php-crawler
A crawler written in php with laravel that find email addresses on the internets.
Given an entry point url, the crawler will search for emails in all the urls available for this entry point domain name.
The emails are downloadable in a text file at any time.
Several users can start searching for emails without viewing the other users' searches (searches are related to a user).

***This repository has not been updated since a long time and I am not using it anymore. Please feel free to fork it and do whatever you want with it.***

[![Build Status](https://travis-ci.org/hedii/php-crawler.svg?branch=master)](https://travis-ci.org/hedii/php-crawler)

A crawler application with a php backend using Laravel, and a js frontend using vuejs, that finds email addresses on the internets.

Given an entry point url, the crawler will search for emails in all the urls available from this entry point domain name.
The emails are downloadable as a text file.

Multiple users can start searching for emails without being able see the other users' searches (searches are related to a single user).

## Screenshots

![Screenshot1](https://user-images.githubusercontent.com/5358048/35198632-c9afcdf2-fef1-11e7-91ec-900b1ff25b62.png)

![Screenshot2](https://user-images.githubusercontent.com/5358048/35198634-cddecb44-fef1-11e7-836b-5dbe16a1bb2a.png)

![Screenshot3](https://user-images.githubusercontent.com/5358048/35198637-d015a180-fef1-11e7-93a0-9eb72e1c1281.png)

![Screenshot4](https://user-images.githubusercontent.com/5358048/35198638-d20ea1a8-fef1-11e7-8ecf-df3cf2c4c8e1.png)

## Server requirements

- PHP >= 7.2.0
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension

## Installation
- Create a mysql database (default name: `php-crawler`)
- Install the repo with [composer](https://getcomposer.org/):
```bash
composer create-project hedii/php-crawler php-crawler
cd php-crawler
```
- Install [npm](https://docs.npmjs.com/getting-started/what-is-npm) dependencies (optional):

- Create a mysql database (default name: `crawler`)
- Install the project with [composer](https://getcomposer.org/):
```bash
npm install
composer create-project hedii/php-crawler crawler
cd crawler
```
- Open the `.env` file, check the database credentials, and modify it if needed:
```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=php-crawler
DB_PORT=3306
DB_DATABASE=crawler
DB_USERNAME=root
DB_PASSWORD=root
DB_PASSWORD=your_password_here
```
- In the `.env` file, set the application url:
```
APP_URL=http://crawler.localhost
```
- Build the app
- Build the crawler application
```bash
php artisan crawler:build
```
- Point your webserver to the public directory: `php-crawler/public`
- Point your web server's document / web root to be the public directory: `/some/path/crawler/public`. The index.php in this directory serves as the front controller for all HTTP requests entering your application. [See Laravel documentation](https://laravel.com/docs/master/installation). I highly recommend using [Laravel Valet](https://laravel.com/docs/master/valet) if you are using a Mac. Otherwise, check [Laravel Homestead](https://laravel.com/docs/master/homestead).
- Done

## Usage

- Navigate to your php-crawler website
- Register a new account
- Create a new search
- Create more searches
- Download the found resources

## Troubleshooting

#### Blank space in path
On some systems, if there is any blank space in the path to the crawler public directory, the crawler app won't work.
Remove any space in folders that are part of the crawler path.

#### MAMP server
If you are running the crawler on a MAMP server, edit `config/database.php` and add a unix socket conf:
```php
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,

'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock', // add this line
],
- Download the found emails

## Testing

```
composer test
```

## Contributing

## Todo
- write php tests
- write js tests
- Crawl for other things than emails
- ...
**All** contributions are welcome :)

Please write some tests if you are adding or modifying features.

## Screenshots
![](https://cloud.githubusercontent.com/assets/5358048/13635825/9a75ec3c-e5fe-11e5-84b8-f4d42973bbda.png)
## License

![](https://cloud.githubusercontent.com/assets/5358048/13635826/9a76ebfa-e5fe-11e5-9bc8-5e770cccfd7a.png)
php-crawler is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
60 changes: 60 additions & 0 deletions app/Console/Commands/BuildCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class BuildCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'crawler:build';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Build the crawler app';

/**
* Execute the console command.
*
* @return mixed
*/
public function handle(): bool
{
$this->comment('Running fresh application migrations');

$returnCode = $this->call('migrate:fresh');

if ($returnCode !== 0) {
$this->error('Unable run the fresh application migrations');

return false;
} else {
$this->info('Application fresh migrations ok');
$this->line('---');
}

$this->comment('Installing Laravel Passport');

$returnCode = $this->callSilent('passport:install');

if ($returnCode !== 0) {
$this->error('Unable to install Laravel Passport');

return false;
} else {
$this->info('Laravel Passport installed');
$this->line('---');
}

$this->info('Crawler app ready!');

return true;
}
}
42 changes: 42 additions & 0 deletions app/Console/Commands/CrawlCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace App\Console\Commands;

use App\Search;
use App\Services\Crawler\Crawler;
use Illuminate\Console\Command;

class CrawlCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'crawler:crawl {search_id : A search id}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Start a new crawler on a given search';

/**
* Execute the console command.
*
* @return bool
*/
public function handle(): bool
{
if (! $search = Search::find($this->argument('search_id'))) {
$this->error("No search with the id `{$this->argument('search_id')}`");

return false;
}

$crawler = new Crawler($search);

return $crawler->run();
}
}
Loading