added gif
authorjosuer08 <josuer08@gmail.com>
Wed, 24 Aug 2022 20:25:26 +0000 (16:25 -0400)
committerjosuer08 <josuer08@gmail.com>
Wed, 24 Aug 2022 20:25:26 +0000 (16:25 -0400)
README.md
hotformathCLI [new file with mode: 0755]
hotformathCLI.go [new file with mode: 0644]
scrapper
scrapper.go [deleted file]
working.gif [new file with mode: 0644]

index 74123f2ff8373408f1dd53c0eb4a251cf149418a..8a7dcadb1b748925731b885d961b58bbec2fe710 100644 (file)
--- a/README.md
+++ b/README.md
@@ -13,6 +13,16 @@ For instalation you just need to download and run the most recent release direct
 `go build hotformathCLI.go` should be enough
 
 # How does this work?
+
+## How to use?
+![usage](./working.gif)
+> Now you can do with those result whatever you please
+
+In this case on the third link you cna find a very interesting gif of andromeda, as promised.
+you can check in there to see what else there is.
+https://www.hep.ucl.ac.uk/~clarke/ParticlePhysicsMaterial/
+
+## What is inside?
 This project uses [rocketlaunchr's google-search module](github.com/rocketlaunchr/google-search) to search google for a term introduced by the user and then scraps the first 3 results
 the query sent to google shoul look a little something like `intext:"[YOUR SEARCH TERM]" -inurl:(jsp|pl|php|html|aspx|htm|cf|shtml) -inurl:(index_of|listen77|mp3raid|mp3toss|mp3drug|index_of|wallywashis) intitle:"index.of./" [specific modifier]`
 where the specific modifier depends on the flag you use
diff --git a/hotformathCLI b/hotformathCLI
new file mode 100755 (executable)
index 0000000..8281534
Binary files /dev/null and b/hotformathCLI differ
diff --git a/hotformathCLI.go b/hotformathCLI.go
new file mode 100644 (file)
index 0000000..e0d9a09
--- /dev/null
@@ -0,0 +1,68 @@
+package main
+
+import (
+       "context"
+       "fmt"
+       "os"
+
+       "github.com/rocketlaunchr/google-search"
+)
+
+func main() {
+    ctx := context.Background()
+    opts := googlesearch.SearchOptions{
+    Limit: 3,
+    CountryCode: "us",
+    LanguageCode: "en",
+    }
+
+
+
+    common:=" -inurl:(jsp|pl|php|html|aspx|htm|cf|shtml) -inurl:(index_of|listen77|mp3raid|mp3toss|mp3drug|index_of|wallywashis) intitle:\"index.of./\" "
+
+    VIDEO:=" (avi|mkv|mov|mp4|mpg|wmv)"
+    AUDIO:=" (ac3|flac|m4a|mp3|ogg|wav|wma)"
+    EBOOK:=" (CBZ|CBR|CHM|DOC|DOCX|EPUB|MOBI|ODT|PDF|RTF|txt)"
+    PICTURES:=" (bmp|gif|jpg|png|psd|tif|tiff)"
+    SOFTWARE:=" (apk|exe|iso|rar|tar|zip)"
+    COMPRESSED:=" (7z|bz2|gz|iso|rar|zip)"
+
+    // implement getModifier()
+
+    modifier:=""
+    switch os.Args[1] {
+        case "-v":
+            modifier = VIDEO
+        case "-a":
+            modifier = AUDIO
+        case "-e":
+            modifier = EBOOK
+        case "-p":
+            modifier = PICTURES
+        case "-s":
+            modifier = SOFTWARE
+        case "-c":
+            modifier = COMPRESSED
+        default:
+            fmt.Println("Usage: scrapper -[flag] \"[your search]\"")
+            fmt.Println("flags = [a]udio [c]ompressed [e]book [p]ictures [s]oftware [v]ideo")
+            os.Exit(0)
+    }
+
+    query := "intext:\"" + os.Args[2] + "\"" + common + modifier
+
+
+    returnLinks, err := googlesearch.Search(ctx, query, opts)
+    if err != nil {
+        fmt.Println("Something went wrong: ", err)
+    return
+    }
+    if len(returnLinks) == 0 {
+        fmt.Println("no results returned: ", returnLinks)
+    }
+
+    for _, result := range returnLinks {
+        fmt.Println("*", result.URL)
+
+    }
+}
index 1268fdc533e98c2c2612f577d7f7172dc0df3f0f..290ebc5ee15206adfc58f844681b6a18e21fc441 100755 (executable)
Binary files a/scrapper and b/scrapper differ
diff --git a/scrapper.go b/scrapper.go
deleted file mode 100644 (file)
index e0d9a09..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-package main
-
-import (
-       "context"
-       "fmt"
-       "os"
-
-       "github.com/rocketlaunchr/google-search"
-)
-
-func main() {
-    ctx := context.Background()
-    opts := googlesearch.SearchOptions{
-    Limit: 3,
-    CountryCode: "us",
-    LanguageCode: "en",
-    }
-
-
-
-    common:=" -inurl:(jsp|pl|php|html|aspx|htm|cf|shtml) -inurl:(index_of|listen77|mp3raid|mp3toss|mp3drug|index_of|wallywashis) intitle:\"index.of./\" "
-
-    VIDEO:=" (avi|mkv|mov|mp4|mpg|wmv)"
-    AUDIO:=" (ac3|flac|m4a|mp3|ogg|wav|wma)"
-    EBOOK:=" (CBZ|CBR|CHM|DOC|DOCX|EPUB|MOBI|ODT|PDF|RTF|txt)"
-    PICTURES:=" (bmp|gif|jpg|png|psd|tif|tiff)"
-    SOFTWARE:=" (apk|exe|iso|rar|tar|zip)"
-    COMPRESSED:=" (7z|bz2|gz|iso|rar|zip)"
-
-    // implement getModifier()
-
-    modifier:=""
-    switch os.Args[1] {
-        case "-v":
-            modifier = VIDEO
-        case "-a":
-            modifier = AUDIO
-        case "-e":
-            modifier = EBOOK
-        case "-p":
-            modifier = PICTURES
-        case "-s":
-            modifier = SOFTWARE
-        case "-c":
-            modifier = COMPRESSED
-        default:
-            fmt.Println("Usage: scrapper -[flag] \"[your search]\"")
-            fmt.Println("flags = [a]udio [c]ompressed [e]book [p]ictures [s]oftware [v]ideo")
-            os.Exit(0)
-    }
-
-    query := "intext:\"" + os.Args[2] + "\"" + common + modifier
-
-
-    returnLinks, err := googlesearch.Search(ctx, query, opts)
-    if err != nil {
-        fmt.Println("Something went wrong: ", err)
-    return
-    }
-    if len(returnLinks) == 0 {
-        fmt.Println("no results returned: ", returnLinks)
-    }
-
-    for _, result := range returnLinks {
-        fmt.Println("*", result.URL)
-
-    }
-}
diff --git a/working.gif b/working.gif
new file mode 100644 (file)
index 0000000..cfc8a98
Binary files /dev/null and b/working.gif differ