Command-line client for http://4rum.i2p
 
 
Go to file
staticvoid 23b4365129 4r-feed: add nix flags to README 2022-07-12 18:39:47 +03:00
4r 4r: Use v1 api 2022-07-12 18:03:17 +03:00
4r-api 4r-api: V1 2022-07-12 14:49:46 +03:00
4r-feed 4r-feed: add nix flags to README 2022-07-12 18:39:47 +03:00
nix Rename servant-polysemy to servant-client-polysemy where possible 2022-06-30 19:44:16 +03:00
.gitignore Empty project 2022-06-16 02:11:53 +03:00
README.md Add `--max-entries` option to `ts` subcommand 2022-06-29 14:33:09 +03:00
flake.lock Add polysemy* dependencies 2022-06-21 11:12:48 +03:00
flake.nix Misc update in flake 2022-07-12 15:40:10 +03:00

README.md

Features

  • As on 27.06.22, all 3 (read-only) API endoints are available
  • Username coloring: 4r calculates hash of a username, takes 1st byte and uses it to color the username
  • Markdown rendering
  • Override location of your I2P router with I2P_HTTP_PROXY env variable.

Future features

  • Wrap lines and prepend corresponding prefix (like > ) to each line.
  • Configure access to 4rum without proxy.
  • Posting/post editing and topic creation (kind of blocked by API itself).
  • Debug flag
  • Cache messages and allow offline-only reading (low-priority).

Build

You need Nix installed to build this project. For advices on building in containers, see Build in container section.

Full build one-liner

git config --global http.http://git.community.i2p.proxy http://127.0.0.1:4444 && \
  git clone http://git.community.i2p/staticvoid/4r.git && cd 4r && \
  nix --extra-experimental-features nix-command --extra-experimental-features flakes shell

After building (that took ~40min on 8-core machine) you'll have a shell with 4r command available.

Usage

> 4r --help
Usage: 4r [-A|--no-ansi] [-c|--columns COLUMNS_NUMBER]
          (COMMAND | COMMAND | COMMAND)

Available options:
  -A,--no-ansi             disable ANSI codes
  -c,--columns COLUMNS_NUMBER
                           number of columns
  -h,--help                Show this help text

Available commands:
  ss                       Request list of sections
  ts                       Request list of topics
  t                        Request a topic

Usual workflow:

  • Print 10 last updated topics: 4r ts -m 10

    Example output:

    > 4r ts -m 10
    Переезжаю: @abzyk at 2022-06-27 21:01:10 #31
    
    Пожелания: @nick at 2022-06-27 20:43:34 #20
    
    Хочу уйти от цивилизации: @NoName at 2022-06-27 20:28:27 #44
    
    Глупые вопросы: @nenet at 2022-06-27 20:04:00 #53
    
    Vipnet Инфотекс: @asics at 2022-06-27 17:23:23 #52
    
    4rum api: @Carvet at 2022-06-27 14:34:49 #41
    
    Создание полностью анонимного чата.: @staticvoid at 2022-06-27 11:33:03 #51
    
    Устройство p2p чата: @Carvet at 2022-06-27 10:02:13 #49
    
    Markdown: @Carvet at 2022-06-26 19:44:12 #35
    
    Всё дрянь, надо делать новый нормальный язык.: @NoName at 2022-06-26 19:33:30 #47
    
  • View all posts (in chronological order) from a topic: 4r t <TOPIC_ID> | less -r. -r flag is needed if you use less because 4r makes use of ANSI escape sequences to format output. You can use -A flag to disable them (only strikethrough text will stay).

    Example output:

    > 4r t 35 | tail -10
    Carvet 2022-06-26 17:12:23 #870
    Нет, всё гораздо тупее, разбивается по разделителю {}, если нечётное количество то вставляются блоки. И да вложенность в таком случае работать не будет. Текущий md парсер не умеет работать со сложными блоками двойной вложенности, а научить его этому сходу довольно сложно.
    
    staticvoid 2022-06-26 17:44:10 #872
    Ну, вложенность - это ещё пусть, зачем вложенные спойлеры мне не понятно. Но в преформатированном блоке ничего рендериться не должно, это нужно исправить
    
    Carvet 2022-06-26 19:44:12 #880
    > Но в преформатированном блоке ничего рендериться не должно, это нужно исправить
    Попробую что-нибуть придумать
    

Build in container

You can use this docker image to run build without installing Nix. You can temporary switch your I2P HTTP Proxy to listen on 192.168.*.* address to be able to reach it from container. If you did this, build one-liner becomes:

git config --global http.http://git.community.i2p.proxy http://<YOUR ADDRESS IN LOCAL NETWORK>:4444 && \
  git clone http://git.community.i2p/staticvoid/4r.git && cd 4r && \
  nix --extra-experimental-features nix-command --extra-experimental-features flakes shell