Jay9596 / devRant_CUI

A devRant CUI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

devRant_CUI

A devRant.io Console User Interface

Screenshot

Table of Contents

  1. Installation
  2. Usage
  3. Todo

Installation

Dependancy

To compile and run

  • Clone this repo
    git clone https://github.com/Jay9596/devRant_CUI.git
    cd devRant_CUI
  • Install Dependancies
    go get github.com/Jay9596/goRant
    go get github.com/jroimartin/gocui
  • Run main.go
    go run main.go
  • Build and Run
    go build
    ./devRant_CUI
  • Install
    go install github.com/Jay9596/devRant_CUI

Download

Download

RUN

This can run on most terminals (not tried many), but has some limitations on Windows Command Prompt when resizing. It can run on Command Prompt, but for Windows use Cmder, Hyper, etc.; for a better experience.

Usage

UI

UI consists of 6 Views, 3 of which are editable.
The main view on left, logo, and output display are not interactive.
The Input window is the main interactive View.
The Sort window is used to set the sort method for fetching rants.
The Limit window is used to set number of rants to display.

Views

  • Sort
    It can take only three inputs: "algo", "recent", "top"
    Any other input will not be accepted
    "algo" is the default sort method

    • To change, just type and press Enter
  • Limit
    It can take any int input
    Default value is 5

    • To change, just type and press Enter
  • Input
    It is a dummy terminal with commands to run the CUI

Note:

It will only accept input after ":/ >", sometimes it can break. Please try to keep inputs after ":/ >" until I can fix this.
Always keep the cursor at the end of text input

Commands

  • help
    This command displays the help, very useful for first timers.
  • rants
    This command fetched rants using the Sort and prints them.
    It fetches 20 at a time, but prints only the Limit specified.
  • next or :n
    This command is used to go to next, i.e next page of list.
    This command prints the next rants, but prints only the limited number.
    This command will auto fetch rants, or specifies if end of section to fetch something else.
    Can be used after 'rants', 'stories', 'weekly', 'search', and 'collabs'
  • rant {int}
    This command is used to open a rant.
    It need a number, the number is shown before a rant, example ">>0".
  • comment or :c
    This command will open a box to view comments of a rant.
    It displays 1 comment at a time.
    To cycle between comments use the down arrow (⬇) and up arrow (⬆) keys.
    To close the comments box, press the right arrow (➡)
  • :m
    This command can be used for long rants, it switchs the focus to main view, where you can scroll.
    In the main view you can scroll down or up using the down arrow (⬇) and up arrow (⬆) keys.
    To switch to Input view, press the right arrow (➡)
  • image or img or :i
    This command can be used to open the attached image in the rant, on the device default browser.
  • back or cd ..
    This command is used to go back to the rants view after opening a rant.
  • profile {username}
    This command will fetch the user info and print it.
    If there is an error, it will be shown in the output view above the input window.
  • search {term}
    This command will search for the term on devrant.io, fetch, and print the search result, i.e the rants.
  • weekly
    This command will fetch the rants posted today, and tagged weekly topic, i.e 'wk-00'.
  • collabs
    This command will fetch the collabs and print them.
  • stories
    This command will fetch and print stories.
    For this, keep the limit small as stories are quiet long, and not many can fit.
  • exit or :q
    This command can be used to call exit, but exit won't close the program.
    For the vim lovers of devRant :q is also available.
    To close "Ctrl + C" is used.
  • clear
    This will clear the input and output views.
  • clean
    This will clean the main view.

Todo

  • Option to view all comments
  • Improve the input terminal
  • Add option to view content of user
  • Refactor Code (split between UI and logic)

Contact

Any and all criticism are appreciated.

If you try this and find any bug, suggestion, or feature.
Feel free to contact me.

About

A devRant CUI


Languages

Language:Go 100.0%