Skip to content

Commit

Permalink
Removed trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhann committed Feb 25, 2021
1 parent dc71474 commit 4ec6641
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<h1 align="center">TUXI</h1>
<p align="center">A CLI tool that scrapes Google search results and SERPs that provides instant and concise answers</p>

##
##

<img src="https://i.ibb.co/sCwYpZ8/general.gif" alt="Video Preview Gif" align="right" width="500px"/>

### How does this work?

The script uses `pup` to scrape Google search results and SERPs.
If the query returns several results, Tuxi will choose the most
If the query returns several results, Tuxi will choose the most
relevant result on the basis of priority.

In addition to scraping, `tuxi` also uses `jq`, `awk` and `sed`
In addition to scraping, `tuxi` also uses `jq`, `awk` and `sed`
to process and return results, and `recode` to unescape html.


Expand All @@ -33,15 +33,15 @@ cURL **tuxi** to your **$PATH** and give execute permissions.
$ sudo curl -sL "https://raw.githubusercontent.com/Bugswriter/tuxi/main/tuxi" -o /usr/local/bin/tuxi
$ sudo chmod +x /usr/local/bin/tuxi
```
> To update, just do `curl` again, no need to `chmod` anymore.
> To update, just do `curl` again, no need to `chmod` anymore.
> To uninstall, simply remove `tuxi` from your **$PATH**, for example `sudo rm -f /usr/local/bin/tuxi`.
### Make
```sh
$ git clone https://github.com/Bugswriter/tuxi.git && cd tuxi/
$ sudo make install
```
> To update, just `git pull` on your local tuxi repository and reinstall with `sudo make install`.
> To update, just `git pull` on your local tuxi repository and reinstall with `sudo make install`.
> To uninstall, simply run `sudo make uninstall`.
### Arch Linux AUR
Expand Down Expand Up @@ -85,7 +85,7 @@ Report bugs at https://github.com/Bugswriter/tuxi/issues.
## Features
**Easily change query language**
**Easily change query language**
Line [8](./tuxi#L8) in `tuxi` contains the language variable which can be changed according the user's preference. However, tuxi will use the system default langauge if none is set.
**Gives corrections**
Expand Down
14 changes: 7 additions & 7 deletions tuxi
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ raw=false
quiet=false

# search result output format (changes if raw=true)
output() {
output() {
printf "%b---%b\n%s\n%b---%b\n" "$G" "$N" "$*" "$G" "$N"
}

Expand All @@ -98,10 +98,10 @@ while getopts "hrq" OPT; do
help_text
exit 0
;;
r)
r)
raw=true
;;
q)
q)
quiet=true
;;
*)
Expand All @@ -121,7 +121,7 @@ shift $((OPTIND-1))
if $raw; then
N=""; R=""; G=""; Y=""; M=""; C="";

output () {
output () {
printf "%s\n" "$*"
}
fi
Expand All @@ -136,11 +136,11 @@ fi
if [ -z "$1" ]; then
if [ $quiet = "false" ]; then
printf "Hi, I'm Tuxi. Ask me anything!\n"
help_text | head -n 1
help_text | head -n 1
fi
exit 0
fi

# Else, all arguments are saved in $query
query="$*"

Expand All @@ -152,7 +152,7 @@ query="$*"
user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0"
google_url="https://www.google.com/search?hl="${LANGUAGE:="${LANG:=en_US}"}""

# Response from Google via cURL (-G: get, -s: silent)
# Response from Google via cURL (-G: get, -s: silent)
google_html=$(curl -Gs --compressed "$google_url" --user-agent "$user_agent" --data-urlencode "q=$query")


Expand Down
6 changes: 3 additions & 3 deletions tuxiqualitytest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ run=""

while getopts "r" o; do
case "${o}" in
r)
r)
raw=true
;;
*)
Expand All @@ -20,7 +20,7 @@ done
#this took to long for me to figure out

if $raw; then
red=""
red=""
run="-r"
fi

Expand Down Expand Up @@ -90,7 +90,7 @@ printf "Testing Translate¬\n" && ./tuxi $run "Vais para cascais? em ingles" 1>>
printf "Testing Translate¬\n" && ./tuxi $run "برمجة in english" 1>>testoutputs.txt && printf "\tpassed.\n" || printf "\tFailed...\n"
printf "Testing Translate¬\n" && ./tuxi $run "mañana in english?" 1>>testoutputs.txt && printf "\tpassed.\n" || printf "\tFailed...\n"
printf "Testing Translate¬\n" && ./tuxi $run "what is mananeo in english" 1>>testoutputs.txt && printf "\tpassed.\n" || printf "\tFailed...\n"
#it looks like you can only convert to english without error
#it looks like you can only convert to english without error


printf "Testing Weather¬\n" && ./tuxi $run "weather new york" 1>>testoutputs.txt && printf "\tpassed.\n" || printf "\tFailed...\n"
Expand Down

0 comments on commit 4ec6641

Please sign in to comment.