diff --git a/mkrss.sh b/mkrss.sh index a6ed227..d2954e1 100755 --- a/mkrss.sh +++ b/mkrss.sh @@ -1,4 +1,5 @@ -#!/usr/bin/env zsh +#!/usr/bin/env nix-shell +#!nix-shell -i zsh rsstpl="rss.tpl" webdir="_site" @@ -12,6 +13,10 @@ finddate(){ local fic="$1" grep 'article-date' < $fic | perl -pe 's#.*([^<]*).*#$1#'|egrep '[0-9]+-[0-9]+-[0-9]+' } +findtitle(){ + local fic="$1" + grep '

' < $fic | perl -pe 's#.*

([^<]*)

.*#$1#' +} getcontent(){ local fic="$1" cat $fic | perl -pe 's#.*<(link|meta).*$##;s#<(img|input) ([^>]*[^/])>##g' | hxselect '#content' @@ -20,11 +25,25 @@ getcontent(){ realname="Yann Esposito" website="https://her.esy.fun" +autoload -U colors && colors + tmpdir=$(mktemp -d) for fic in $webdir/posts/**/*.html; do - rssdate=$(formatdate $(finddate $fic)) + printf "%-40s" "$fic" + d=$(finddate $fic) + echo -n " [$d]" + rssdate=$(formatdate $d) + title=$(findtitle $fic) + printf ": %-30s" "$title" blogfile="$(echo $fic | perl -pe 's#.*?/posts/#/posts/#')" - printf "\\n\\n%s\\n%s%s\\n%s\\n\\n\\n\\n" "$realname" "$website" "$blogfile" "$rssdate" "$(getcontent "$fic")" >> "$tmpdir/rss" + printf "\\n\\n%s\\n%s%s\\n%s\\n\\n\\n\\n" "$title" "$website" "$blogfile" "$rssdate" "$(getcontent "$fic")" >> "$tmpdir/${d}-$(basename $fic).rss" + echo " [${fg[green]}OK${reset_color}]" +done +for fic in $(ls $tmpdir/*.rss | sort -r); do + # echo $fic + cat $fic >> $tmpdir/rss done sed "//r $tmpdir/rss" "$rsstpl" > "$rssfile" +rm -rf $tmpdir +echo "RSS Generated" diff --git a/src/posts/how-i-internet.org b/src/posts/how-i-internet.org index ca51308..e1e01fd 100644 --- a/src/posts/how-i-internet.org +++ b/src/posts/how-i-internet.org @@ -22,15 +22,16 @@ how you consume Internet for the best. + Control real-time interactions #+end_notes -The way I and most people use Internet as changed drastically in a few years. +The way we use Internet as changed drastically in a few years. It started with social networks and smartphones. More recently, applications started to introduce "features" targeting our "lower brain" or "social brain". It is not unusual to stay a lot longer on our smartphone than what we expected. -Since the introduction of those methods, more and more people experience -difficulties to balance their life, to focus a long time on some subject, -and even might feel a lot more social anxieties. +Those changes start to influence our life balance. + +Focus on long time on some subject, and even might feel a lot more social +anxieties. One solution is of course to totally get rid of those platforms. But it would mean throw away all the benefit they provide.