gemini-capsule

My gemini capsule
git clone git://jb55.com/gemini-capsule
Log | Files | Refs

2021-10-15-simple-gemini-fzf-feed-viewer.gmi (1272B)


      1 # A simple gemini feed viewer using grep and fzf
      2 
      3 Gemini markup is line based and so simple you can use gmni, grep and fzf as a simple feed viewer.
      4 
      5 Here's the bash one-liner:
      6 
      7 ```
      8 gmni -j always gemini://warmedal.se/~antenna/index.gmi |
      9 grep -P '^=>.*\d{4}-\d\d-\d\d' |
     10 sed 'y, ,\t,;s,\t, ,3g' |
     11 awk -v FS=$'\t' -v OFS=$'\t' '{ print $3,$2 }' |
     12 fzf |
     13 cut -d $'\t' -f2 |
     14 xargs gemini
     15 ```
     16 
     17 What this does:
     18 
     19 * gmni is Drew's curl-like program for fetching gemini pages
     20 * grep filters out the links matching the standard date feed format
     21 * sed tabifys the first two spaces so that it's easier to work with
     22 * awk moves the article title to the first column and link to the second so that it will be nice to view in fzf
     23 * fzf for user selection
     24 * cut pulls out the link from the selection
     25 * xargs launches your gemini client of choice with the selection
     26  
     27 I started working on this because I wanted to create a simple script that pulled all the feeds I was interested in, sort them by date, and launch them. This could be a simple way to pull feeds without having to run a more complicated gemroll aggregator script. Working on that next!
     28 
     29 One small complication right now is that it can't jump to relative links on pages, but you can only expect so much from a one-liner 😅