Giter Site home page Giter Site logo

fossabot / radium Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spy16/radium

0.0 1.0 0.0 58 KB

radium is a platform (client and optional server) for viewing reference articles, cheat sheets, snippets etc.

License: MIT License

Makefile 1.18% Go 98.82%

radium's Introduction

radium

GoDoc Build Status Go Report Card FOSSA Status

radium is a platform (client and optional server) for viewing reference articles, cheat sheets etc. right from a shell. radium is written in Go (Golang)

Install

  1. Download the latest pre-built binary for your platform from releases page.
  2. Run the binary! (Optionally, create a radium.yaml file in ~ to customize)

Build

radium requires Go 1.8+ to build. Simply run make command in the source directory to build and install the binary into your $GOPATH/bin directory. If you just want to build the binary, run make build

Run

You can run radium --help to see the list of available commands.

Querying from command-line

radium query "append file in go"

radium query dir --attr platform:windows

radium query go

--attr is not part of radium framework but part of the source implementation itself. Weather to consume the attributes or not is decided by the source implementation.

Querying from curl

For this, you need to run radium in server mode first using the command: radium serve --addr=localhost:8080

Then

curl "localhost:8080/search?q=append+file+in+go"

curl "localhost:8080/search?q=dir&platform=windows"

curl "localhost:8080/search?q=go"

When using http api, all query parameters except q and strategy will be assumed to be attributes

Running as Clipboard Monitor

Run radium serve --clipboard to start radium in server+clipboard mode (pass --addr="" to run in clipboard-only mode).

Now, everytime you copy some text into clipboard (which is less than 5 words), radium is going to run a query and try to find some results. If a result is found, it will be pasted back into the clipboard

How it works?

radium works by querying/scraping different knowledge sources (e.g. tldr-pages, LearnXInYMinutes etc.). A Source in radium is a Go interface and can be implemented to add new references to provide more relevant results.

type Source interface {
  Search(query Query) ([]Article, error)
}

Currently following implementations are available:

  1. sources.TLDR using the awesome tldr-pages project
  2. sources.LearnXInY using the awesome Learn X In Y Minutes project
  3. cheatsh.CheatSh using the awesome cheat.sh project
  4. sources.Radium which can be used to query other radium servers to enable distributed setup
  5. wikipedia.Wikipedia which queries and extracts first paragraph from Wikipedia
  6. duckduckgo.DuckDuckGo which uses DuckDuckGo Instant Answer API

See sources/README.md for more information

TODO:

  • Make sources configurable
    • sources to be used should be configurable per instance
  • a configurable caching mechanism to enable offline usage
  • Add more sources
    • Wikipedia
    • DuckDuckGo
  • Enable markdown to console colored output ?
  • Enable clipboard monitoring
    • everytime user copies a string, run radium query
    • if a result is available within certain time window, replace the clipboard content with the solution
    • enable query only if clipboard text is in special format to reduce unwanted paste-backs

License

FOSSA Status

radium's People

Contributors

fossabot avatar spy16 avatar

Watchers

 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.