diff --git a/run.sh b/run.sh index d4f0c24..10b5c0c 100755 --- a/run.sh +++ b/run.sh @@ -1,3 +1,3 @@ #!/bin/bash -go run main.go text-google.go images.go imageproxy.go video.go map.go \ No newline at end of file +go run main.go text-google.go images.go imageproxy.go video.go map.go text.go \ No newline at end of file diff --git a/text-google.go b/text-google.go index 0a49342..abf874f 100644 --- a/text-google.go +++ b/text-google.go @@ -74,7 +74,7 @@ func PerformTextSearch(query, safe, lang string) ([]TextSearchResult, error) { return results, nil } -func handleTextSearch(w http.ResponseWriter, query, safe, lang string) { +func handleTextSearchGoogle(w http.ResponseWriter, query, safe, lang string) { // Perform the text search results, err := PerformTextSearch(query, safe, lang) if err != nil { diff --git a/text.go b/text.go index e69de29..9e967b5 100644 --- a/text.go +++ b/text.go @@ -0,0 +1,17 @@ +// text.go +package main + +import ( + "net/http" +) + +// HandleTextSearch determines which text search engine to use and calls the appropriate function +func handleTextSearch(w http.ResponseWriter, query, safe, lang string) { + // Add logic here to determine which search engine to use, for now it just uses Google + handleTextSearchGoogle(w, query, safe, lang) +} + +func displayResults(w http.ResponseWriter, results string) { + // Implement your result display logic here + w.Write([]byte(results)) +}