Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://gitlab.com/aaronNG/reddio

a command-line interface for Reddit written in POSIX sh
https://gitlab.com/aaronNG/reddio

cli curl jq minimal posix reddit sh shell suckless

Last synced: 6 days ago
JSON representation

a command-line interface for Reddit written in POSIX sh

Awesome Lists containing this project

README

        

# reddio

reddio is a command-line interface for Reddit written in POSIX sh.

![example session](example.png?raw=true "Example session")

## Why

Terminal user interfaces suck. Because `reddio` is command-line only, it's way more flexible than a TUI and integrates much better with other command-line utilities.

## Dependencies

* A POSIX compliant shell as `/bin/sh`
* `coreutils` (GNU, busybox or others should work)
* `cURL`
* `jq`
* `netcat` optional (for authentication)

## Installation

### System-wide installation into /usr/local

```shell
make install
```

### Home directory installation into $HOME/.local

```shell
make PREFIX="$HOME/.local" install
PATH=$HOME/.local/bin:$PATH
```

## Usage

```
reddio [-chqvV] [ []]

-c Use instead of the default config
-s Use instead of the default
-q Quiet
-v Verbose mode
-V Print version information and exit
-h Print this help and exit

Commands:
comment delete edit login logout message print submit
(un)follow (un)hide (un)marknsfw (un)read (un)save
(un)spoiler (un)subscribe upvote downvote unvote.

A unique part, of the beginning of the command, is also valid. For
example, 'p' for print or 'logi' for login.
```

All sub-commands also have a `-h` option for printing usage information.

## Examples

Print the two hottest submissions of r/commandline

```shell
$ reddio print -l 2 r/commandline
18 Suggestions on mp3 streams for background music (self.commandline)
https://www.reddit.com/r/commandline/comments/cdfq7p/suggestions_on_mp3_streams_for_background_music/
14 comments | submitted 8.4 hours ago by jherazob to r/commandline t3_cdfq7p

16 Βulk image resizing (cli) (youtube.com)
https://www.youtube.com/attribution_link?a=NkwKg-k3QY0&u=%2Fwatch%3Fv%3DidyBFtocLaU%26feature%3Dshare
11 comments | submitted 1.2 days ago by vagelis_prokopiou to r/commandline t3_cd2zfg
```

Count the words of a self-post

```shell
$ reddio print -f '$text' by_id/t3_cdfq7p | wc -w
156
```

Print the top 5 urls of the month of r/linux

```shell
$ reddio print -f '$num. $url$nl' -l 5 -t month r/linux/top
1. https://i.redd.it/edqgfmhoew431.jpg
2. https://twitter.com/ISPAUK/status/1146725374455373824
3. https://www.raspberrypi.org/blog/raspberry-pi-4-on-sale-now-from-35/
4. https://i.redd.it/30c8yyn390a31.jpg
5. https://i.redd.it/6k5u6euppn931.jpg
```

Submit a selfpost to r/test

```shell
$ reddio submit -t 'Hello, World!' r/test 'Test submission using reddio - CLI reddit reader'
```

Check for new messages and comment replies

```shell
$ reddio print -l 1 -f '${new:+New message(s)!$nl}' message/unread
New message(s)!
```

Without `-t `, text is read from stdin

```shell
$ echo 'Hello, World! | reddio comment t1_anid36
$ reddio comment t1_anid36