Git Product home page Git Product logo

roogle's Introduction

roogle

Take random sentences out of a text and check if a search engine finds sites containing it.

Example:

$ cat my-text.txt | npx roogle | sh
Usage: roogle [options]

Options:
  -v, --version          output the version number
  -l, --length [chars]   Minimum amount of characters in a selected sentence (default: 50)
  -n, --sentences [num]  Amount of sentences to randomly select (default: 5)
  -r, --raw              Write raw sentences without url-encode and with punctuation.
  -p, --prefix [prefix]  Add a prefix to the sentences (default: "open \"https://www.google.com/search?q=")
  -s, --suffix [suffix]  Add a suffix to the sentences (default: "\"")
  -P, --disable-prefix   Removes the prefix
  -S, --disable-suffix   Removes the suffix
  -h, --help             output usage information

Example usage with PDFs

To get roogle running with PDFs, we need to do these steps:

  1. Install xpdf, as it includes the pdftotext command
  2. Use pdftotext to stream the text into roogle
  3. Open the resulting URLs

Install xpdf

$ brew install xpdf

Stream PDF content into roogle

$ pdftotext -enc UTF-8 my-pdf.pdf - | npx roogle

Open the resulting URLs

If you're using MacOS, you can pipe the output into sh to let the OS open the URLs directly.

$ pdftotext -enc UTF-8 my-pdf.pdf - | npx roogle | sh

If you're using Linux, you might want to use xdg-open instead of the regular open to be able to pipe it into a shell.

$ pdftotext -enc UTF-8 my-pdf.pdf - | npx roogle --prefix 'xdg-open "https://www.google.com/search?q=' | sh

roogle's People

Contributors

narigo avatar

Stargazers

GAURAV avatar

Watchers

James Cloos avatar  avatar  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.