Crates.io | lobsters |
lib.rs | lobsters |
version | 0.2.0 |
source | src |
created_at | 2019-04-25 02:39:52.819826 |
updated_at | 2020-01-02 05:50:29.100496 |
description | Asynchronous http client for the lobste.rs website |
homepage | |
repository | https://git.sr.ht/~wezm/lobsters |
max_upload_size | |
id | 129991 |
size | 22,359 |
This is a pair of Rust crates. One implements an asynchronous HTTP client for the Lobsters website, and other websites running its code. The other implements a terminal user interface using the client. Lobsters is a friendly programming oriented link sharing community.
This client crate allows the following actions to be performed:
It did this mostly to practice building asynchronous HTTP clients in Rust and gain more experience with the async ecosystem. Then I needed something to test the client so I built the UI. You can read more about building the client and TUI on my blog.
The lobsters-cli
crate in this repo provides an example of the crate in use.
You can try out out by downloading a pre-compiled binary, available below.
The TUI uses the following key bindings:
j
or ↓
— Move cursor downk
or ↑
— Move cursor uph
or ←
— Scroll view leftl
or →
— Scroll view rightEnter
— Open story URL in browserc
— Open story comments in browserq
or Esc
— Quitlobsters
is a single binary available for a handful of platforms. To download
the latest release do the following:
curl -L https://releases.wezm.net/lobsters/lobsters-0.1.0-x86_64-unknown-freebsd.tar.gz | tar zxf -
curl -L https://releases.wezm.net/lobsters/lobsters-0.1.0-x86_64-unknown-linux-musl.tar.gz | tar zxf -
curl -L https://releases.wezm.net/lobsters/lobsters-0.1.0-x86_64-apple-darwin.tar.gz | tar zxf -
curl -L https://releases.wezm.net/lobsters/lobsters-0.1.0-x86_64-unknown-netbsd.tar.gz | tar zxf -
curl -L https://releases.wezm.net/lobsters/lobsters-0.1.0-x86_64-unknown-openbsd.tar.gz | tar zxf -
curl -L https://releases.wezm.net/lobsters/lobsters-0.1.0-arm-unknown-linux-gnueabihf.tar.gz | tar zxf -
The binary should be in your current directory and can be run as follows:
./lobsters
Feel free to move it elsewhere (~/.local/bin
for example).
Build Status:
Note: You will need the Rust compiler installed.
git clone https://git.sr.ht/~wezm/lobsters
cargo install --path lobsters/lobsters-cli
There is a script that will build binaries for several platforms. You will need
an arm-linux-gnueabihf
and musl
toolchain installed as well as those rustup
targets installed.
./build-all-platforms
Run the test suite:
cargo test
If you have code or patches you wish to contribute, the preferred mechanism is a git pull request. Push your changes to a git repository somewhere (Sourcehut, GitHub, GitLab, whatever). Ensure that contributions don't break the tests and add new ones when appropriate.
Assuming you have followed the build steps above you would do the following to push to your own fork on Sourcehut, change the git URL to match wherever your forked repo is:
git remote rename origin upstream
git remote add origin git@git.sr.ht:~yourname/lobsters
git push -u origin master
Then generate the pull request:
git fetch upstream master
git request-pull -p upstream/master origin
And copy-paste the result into a plain-text email to wes@wezm.net.
You may alternately use a patch-based approach as described on https://git-send-email.io.
This project is dual licenced under: