Coder Social home page Coder Social logo

tuxi's Introduction

TUXI

A CLI tool that scrapes Google search results and SERPs that provides instant and concise answers

Video Preview Gif

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 relevant result on the basis of priority.

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

Watch this video for more info

Also checkout BugsWriter's YouTube channel for more scripts like this.

Requirements

  • pup - CLI tool for processing HTML.
  • recode - Charset converter tool and library.
  • jq - Command-line JSON processor.

Installation

cURL

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 uninstall, simply remove tuxi from your $PATH, for example sudo rm -f /usr/local/bin/tuxi.

Make

$ 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 uninstall, simply run sudo make uninstall.

Arch Linux AUR

Tuxi is available as the tuxi-git package in the AUR.

$ yay -S tuxi-git

Usage

$ tuxi "Is Linux better than Windows?"
---
Linux has a reputation for being fast and smooth while
Windows 10 is known to become slow and slow over
time. Linux runs faster than Windows 8.1 and Windows 10
along with a modern desktop environment and qualities of the
operating system while windows are slow on older hardware.
---
  • Quotations are optional, but should be used if you want to search with special characters (?=!|&<>%$#/\).
  • You can also write your query as a statement, e.g: tuxi linus torvalds birthday.
  • The -r option will make the output not have formatting, which can be convenient for use in scripts.
  • The -q option silences "Did you mean?" and Tuxi's greeting on calling tuxi.

Use -h to display the help message.

$ tuxi -h
Usage: tuxi [options] query

Options:
  -h                    Show this help message and exit.
  -r                    Raw search results.
                        (no pretty output, no colors)
  -q                    Only output search results.
                        (silences "Did you mean?", greeting, usage)

Report bugs at https://github.com/Bugswriter/tuxi/issues.

Features

Easily change query language
Line 8 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

$ tuxi linux torvalds birthday
> Did you mean linus?
---
28 December 1969
---

When you know it's actually linux torvalds -q option

$ tuxi -q linux torvalds birthday
---
28 December 1969
---

Raw formatting for output (no colors) -r option

Useful for e.g scripting notify-send.

$ tuxi -r linux torvalds birthday
> Did you mean linus?
28 December 1969

Math operations

$ tuxi "log(30)"
---
1.4771212547196624
---

Translate

$ tuxi "I love you in japanese"
---
わたしは、あなたを愛しています
---
$ tuxi "わたしは、あなたを愛しています in english"
---
I love you
---

And much more (lyrics, weather, conversions...)

License

This project is licensed under GPL-3.0.

Contributing

If you want to contribute, please see CONTRIBUTING.

tuxi's People

Contributors

bugswriter avatar colonvirus avatar marcopolskava avatar sudocanttype avatar beyondmagic avatar d-shaun avatar genghius avatar awkwardpeak7 avatar neryddeedsphilly avatar dadyarri avatar khuei avatar sdushantha avatar thejackimonster avatar w1kee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.