summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrothedev <grothedev@gmail.com>2024-12-08 21:55:29 -0600
committergrothedev <grothedev@gmail.com>2024-12-08 21:55:29 -0600
commit6678df9b26a0e0997c87a00439945dc4855b5041 (patch)
tree88b7265e4f11ec26b99cf40f67da1db7d212799f
parentedf1f5b3c0acbfe8d55bdcc53d7a7afa2d309c7c (diff)
4chan query
-rw-r--r--app/Http/Controllers/SiteController.php12
-rwxr-xr-xroutes/web.php2
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