diff options
| author | grothedev <grothedev@gmail.com> | 2024-12-08 21:55:29 -0600 |
|---|---|---|
| committer | grothedev <grothedev@gmail.com> | 2024-12-08 21:55:29 -0600 |
| commit | 6678df9b26a0e0997c87a00439945dc4855b5041 (patch) | |
| tree | 88b7265e4f11ec26b99cf40f67da1db7d212799f | |
| parent | edf1f5b3c0acbfe8d55bdcc53d7a7afa2d309c7c (diff) | |
4chan query
| -rw-r--r-- | app/Http/Controllers/SiteController.php | 12 | ||||
| -rwxr-xr-x | routes/web.php | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/app/Http/Controllers/SiteController.php b/app/Http/Controllers/SiteController.php index 40c4660..251859f 100644 --- a/app/Http/Controllers/SiteController.php +++ b/app/Http/Controllers/SiteController.php @@ -62,4 +62,16 @@ class SiteController extends Controller } return $res; } + + public function search4chan(Request $req){ + $query = $req->input('query'); + $board = ""; + if ( $req->input('board') != null) { + $board = $req->input('board').'/'.$query; + } + $shellcmd = escapeshellcmd("python ./search4chan.py ${query} ${board}"); + exec($shellcmd, $res, $ret); + return $res; + + } } diff --git a/routes/web.php b/routes/web.php index c450da5..02fe4a7 100755 --- a/routes/web.php +++ b/routes/web.php @@ -16,6 +16,8 @@ Route::get('/f/{path}', function($path){ return response()->file(storage_path('/public/uploads/' . $path)); }); +Route::get('/4', [SiteController::class, 'search4chan']); + Route::get('/{v}', function($v){ return view($v); });
\ No newline at end of file |
