RSS builder fix, proof read, minor CSS improvements

This commit is contained in:
Yann Esposito (Yogsototh) 2019-09-25 15:36:52 +02:00
parent e229deb765
commit d2c26615d8
Signed by untrusted user who does not match committer: yogsototh
GPG Key ID: 7B19A4C650D59646
4 changed files with 142 additions and 96 deletions

View File

@ -3,9 +3,9 @@
rootdir=${0:h} rootdir=${0:h}
echo $rootdir echo $rootdir
echo -n "Building RSS" echo "Building RSS"
./mkrss.sh ./mkrss.sh
echo " [done]" echo "RSS Built"
echo -n "Publishing" echo -n "Publishing"
rsync --progress --partial -avHe ssh $rootdir/_site/ root@shoggoth1:/var/www/her.esy.fun/ --delete rsync --progress --partial -avHe ssh $rootdir/_site/ root@shoggoth1:/var/www/her.esy.fun/ --delete
echo " [done]" echo " [done]"

View File

@ -5,21 +5,26 @@ rsstpl="rss.tpl"
webdir="_site" webdir="_site"
rssfile="$webdir/rss.xml" rssfile="$webdir/rss.xml"
xmlize() {
local fic="$1";
hxclean $fic
}
formatdate() { formatdate() {
local d=$1 local d=$1
LC_TIME=en_US date --date $d +'%a, %d %b %Y %H:%M:%S %z' LC_TIME=en_US date --date $d +'%a, %d %b %Y %H:%M:%S %z'
} }
finddate(){ finddate(){
local fic="$1" local fic="$1"
grep 'article-date' < $fic | perl -pe 's#.*<span class="article-date">([^<]*)</span>.*#$1#'|egrep '[0-9]+-[0-9]+-[0-9]+' cat $fic | hxselect -c '.article-date'
} }
findtitle(){ findtitle(){
local fic="$1" local fic="$1"
grep '<h1>' < $fic | perl -pe 's#.*<h1>([^<]*)</h1>.*#$1#' cat $fic | hxselect -c 'h1'
} }
getcontent(){ getcontent(){
local fic="$1" local fic="$1"
cat $fic | perl -pe 's#.*<(link|meta).*$##;s#<(img|input) ([^>]*[^/])>#<img $1/>#g' | hxselect '#content' cat $fic | hxselect '#content'
} }
realname="Yann Esposito" realname="Yann Esposito"
@ -30,13 +35,16 @@ autoload -U colors && colors
tmpdir=$(mktemp -d) tmpdir=$(mktemp -d)
for fic in $webdir/posts/**/*.html; do for fic in $webdir/posts/**/*.html; do
printf "%-40s" "$fic" printf "%-40s" "$fic"
d=$(finddate $fic) xfic="$tmpdir/$fic.xml"
mkdir -p $(dirname $xfic)
xmlize $fic > $xfic
d=$(finddate $xfic)
echo -n " [$d]" echo -n " [$d]"
rssdate=$(formatdate $d) rssdate=$(formatdate $d)
title=$(findtitle $fic) title=$(findtitle $xfic)
printf ": %-30s" "$title" printf ": %-30s" "$title"
blogfile="$(echo $fic | perl -pe 's#.*?/posts/#/posts/#')" blogfile="$(echo $fic | perl -pe 's#.*?/posts/#/posts/#')"
printf "\\n<item>\\n<title>%s</title>\\n<guid>%s%s</guid>\\n<pubDate>%s</pubDate>\\n<description><![CDATA[\\n%s\\n]]></description>\\n</item>\\n\\n" "$title" "$website" "$blogfile" "$rssdate" "$(getcontent "$fic")" >> "$tmpdir/${d}-$(basename $fic).rss" printf "\\n<item>\\n<title>%s</title>\\n<guid>%s%s</guid>\\n<pubDate>%s</pubDate>\\n<description><![CDATA[\\n%s\\n]]></description>\\n</item>\\n\\n" "$title" "$website" "$blogfile" "$rssdate" "$(getcontent "$xfic")" >> "$tmpdir/${d}-$(basename $fic).rss"
echo " [${fg[green]}OK${reset_color}]" echo " [${fg[green]}OK${reset_color}]"
done done
for fic in $(ls $tmpdir/*.rss | sort -r); do for fic in $(ls $tmpdir/*.rss | sort -r); do

View File

@ -106,6 +106,17 @@ td, th {
border-right: solid 1px; border-right: solid 1px;
border-left: solid 1px; border-left: solid 1px;
} }
sup {
vertical-align: top;
position: relative;
top: -.25em;
}
sup > a {
text-decoration: none;
padding: 1px 2px;
font-weight: bold;
background: var(--reveal-background);
}
/* Markdown tricks */ /* Markdown tricks */
h1 { h1 {
@ -369,7 +380,7 @@ input#simple:target ~ .main {
--color-h6: #333; --color-h6: #333;
--color-link: var(--magenta); --color-link: var(--magenta);
font-family: "Helvetica Neue"; font-family: "Helvetica Neue";
font-size: 16px; font-size: 14px;
line-height: 1.5em; line-height: 1.5em;
} }
input#simple:checked ~ .main .content, input#simple:checked ~ .main .content,
@ -383,7 +394,7 @@ input#simple:target ~ #labels {
background: #fff; background: #fff;
color: #333; color: #333;
font-family: "Helvetica Neue"; font-family: "Helvetica Neue";
font-size: 16px; font-size: 14px;
line-height: 1.5em; line-height: 1.5em;
} }
input#simple:checked ~ .main code, input#simple:checked ~ .main code,
@ -554,7 +565,7 @@ input#darksimple:target ~ .main {
--color-link: var(--yellow); --color-link: var(--yellow);
font-family: "Helvetica Neue", sans-serif; font-family: "Helvetica Neue", sans-serif;
font-weight: 300; font-weight: 300;
font-size: 16px; font-size: 14px;
line-height: 1.5em; line-height: 1.5em;
} }
input#darksimple:checked ~ #labels , input#darksimple:checked ~ #labels ,
@ -563,7 +574,7 @@ input#darksimple:target ~ #labels {
color: #ccc; color: #ccc;
font-family: "Helvetica Neue", sans-serif; font-family: "Helvetica Neue", sans-serif;
font-weight: 300; font-weight: 300;
font-size: 16px; font-size: 14px;
line-height: 1.5em; line-height: 1.5em;
} }
input#darksimple:checked ~ .main code, input#darksimple:checked ~ .main code,

View File

@ -1,5 +1,5 @@
#+TITLE: How I Internet #+TITLE: How I Internet
#+SUBTITLE: Self hosting other advantages #+SUBTITLE: Some unexpected consequences of self hosting
#+AUTHOR: Yann Esposito #+AUTHOR: Yann Esposito
#+EMAIL: yann@esposito.host #+EMAIL: yann@esposito.host
#+DATE: [2019-09-23 Mon] #+DATE: [2019-09-23 Mon]
@ -23,29 +23,34 @@ how you consume Internet for the best.
#+end_notes #+end_notes
The way we 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. A popular meme about it states:
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.
Those changes start to influence our life balance.
Focus on long time on some subject, and even might feel a lot more social #+begin_quote
anxieties. - toilet ⇒ 5min
- toilet + smarphone ⇒ 55min
#+end_quote
One solution is of course to totally get rid of those platforms. The book Digital Minimalism[fn:dm] provide a lot of great information on
But it would mean throw away all the benefit they provide. the subject.
In particular the apparition of grabbing features that target our "social
brain".
So my personal solution is to still keep the best of those platform while One solution to protect ourselve from the problem generated by those
minimizing my exposure to most /anti-features/. plateform would be to get rid of those them.
All start by how I produce content. But those platform are useful.
And it naturally affect also how I consume information on Internet.
My current[fn:1] personal solution is to still keep the useful feature of those platform while
minimizing my exposition to most /anti-features/.
Everything start by how I produce content.
It then affect how I consume Internet.
[fn:posse] https://indieweb.org/POSSE [fn:posse] https://indieweb.org/POSSE
[fn:dm] http://www.calnewport.com/books/digital-minimalism/ [fn:dm] http://www.calnewport.com/books/digital-minimalism/
[fn:espial] https://github.com/jonschoning/espial [fn:espial] https://github.com/jonschoning/espial
[fn:node-red] https://nodered.org [fn:node-red] https://nodered.org
[fn:pinboard] https://pinboard.in [fn:pinboard] https://pinboard.in
[fn:1] While I wrote this article I already improved a lot my workflow, but
it plan to continue to make my Internet usage evolve for a long time.
* Producing * Producing
:PROPERTIES: :PROPERTIES:
@ -54,42 +59,42 @@ And it naturally affect also how I consume information on Internet.
I self host many services. I self host many services.
I control my data, and then I broadcast those info to different platforms. I control my data, and then I broadcast those info to different platforms.
This is called POSSE[fn:posse].
** Articles: Self hosted blog ** Articles: Self hosted blog
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: self-hosting :CUSTOM_ID: self-hosting
:END: :END:
First thing, is I /blog/. First thing the classical /blog/.
Writing a blog article is an intermediate format.
A lot simpler than a real article for some journal, but also should contain It is more and more common now, to simply use micro-blogging, or commenting.
more details than just a "micro-blog status" where you can mostly express I think blog article format is important.
an impression, a photo, an opinion... It is a longer form than a comment or a tweet.
But in the same time, it is not necessary to work on it as hard as for a
journal article.
I wrote an [[file:new-blog.org][article]] that explain the technical details behind my blog. I wrote an [[file:new-blog.org][article]] that explain the technical details behind my blog.
It also describes how I try to make it a /respectful/ blog. It also describes how I try to make it /respectful/.
The harder part if you want to do it yourself will be about self-hosting it. To self host anything, you should buy a domain name, and configure you DNS
You need to buy a domain name, and configure you DNS correctly. correctly.
This is not something tremendously hard, but don't expect to do that as That is certainly the biggest blocker for non technical people.
easily as registering to a private service.
But hey, I really believe this is worth the price.
** Code: Git Broadcast ** Code: Git Broadcast
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: git-broadcast :CUSTOM_ID: git-broadcast
:END: :END:
I also self-host the code for my open-source projects. I self-host the code of my open-source projects.
But, Github is the developer social network. As Github is the de-facto developer social network, it is easier to find
It is easier to find contributor on Github than on your self-hosted repository. contributor on Github than on your self-hosted repository.
So, I sync my code between my self-hosted instance and GitHub. Thus I sync my repositories between my self-hosted instance and GitHub.
So if tomorrow something is wrong with Github, I could easily switch to my If something goes wrong with Github, I could easily switch to my self
self hosted repositories only. hosted repositories only.
Here is how you can configure your git repositories to push to multiple This is how I configured my git repos to push to multiple URLs:
URLs:
#+begin_src #+begin_src
git remote set-url origin --push --add <remote-url> git remote set-url origin --push --add <remote-url>
@ -100,21 +105,24 @@ git remote set-url origin --push --add <another-remote-url>
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: espial :CUSTOM_ID: espial
:END: :END:
I also like a tool to synchronize articles on the Internet I like and I also wanted a tool to keep track of web pages I like and might want to
appreciate. keep track of.
For that, I use [[https://github.com/jonschoning/espial][espial]] which is an open-source, web-based bookmarking server. For that, I self host [[https://espial.esy.fun/u:yogsototh][espial]][fn:espial]; an open-source, web-based
bookmarking server.
It is a very easy to install, this is a single binary. It is a very easy to install, this is a single binary.
Your bookmark are kept in a single sqlite file. Your bookmark are kept in a single sqlite file.
This is perfect if you want to keep a lot of bookmarks some private some This is perfect if you want to keep a lot of bookmarks some private some
public. public.
But as well as I use espial I plan (I haven't done it yet) to synchronize
my bookmark from espial[fn:espial] to pinboard[fn:pinboard].
** Notes: Espial ** Notes: Espial
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: notes--espial :CUSTOM_ID: notes--espial
:END: :END:
Another feature provided by [[https://github.com/jonschoning/espial][espial]] is the ability to save notes. Another feature provided by espial[fn:espial] is the ability to save [[https://espial.esy.fun/u:yogsototh/notes][notes]].
You can generate public or private notes. You can generate public or private notes.
I intend to use those notes for my "micro-blogging" needs. I intend to use those notes for my "micro-blogging" needs.
@ -139,36 +147,29 @@ feeds of my public bookmarks as well as an RSS feed for my public notes.
:END: :END:
With those RSS, it is then quite natural to syndicate elsewhere. With those RSS, it is then quite natural to syndicate elsewhere.
For that I use [[https://nodered.org][node-red]]. For that I use node-red[fn:node-red].
This is a web-based tool that make it easy to write /flows/. This is a web-based tool that make it easy to write /flows/.
Think about it like a super IFTTT. Think about it like a super IFTTT.
To give you an example, each time I save a new public bookmark, a new blog To give you an example, each time I save a new public bookmark, a new blog
post, a new note, I tweet it. post, a new note, I tweet it.
* Consuming * Consuming
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: consuming :CUSTOM_ID: consuming
:END: :END:
As I said, now that I can generate my content using my own, self-made Since I generate my content using my own, self-made environment, it also
environment, it also influenced a lot the way I consume and interact with influenced a for the best the way I consume and interact on Internet.
other people on the Internet.
I consumed a lot of /news/ directly from my smartphone. Before I read a lot of /news/ directly from my smartphone.
Most of the time using an app dedicated to some social network. Most of the time using many apps dedicated to some social networks.
The natural presentation is an infinite scroll of content, with buttons to The natural presentation is an infinite scroll of content, with buttons to
engage in the social network with likes/upvotes/comments etc... engage in the social network with likes/upvotes/comments etc...
Most of the time, with enabled notifications to answer ASAP to anyone that Most of the time, notifications where enabled by fear of missing a comment
might [[https://www.xkcd.com/386/]["be wrong on the Internet"]]. or any kind of interaction.
Here is how I consume Internet content now.
** News
:PROPERTIES:
:CUSTOM_ID: news
:END:
Before explaining how I consume Internet news, I like to make a short Before explaining how I consume Internet news, I like to make a short
digression: digression:
@ -179,14 +180,22 @@ via *news*.
More than that, that now, Internet is almost synonymous to news on the web. More than that, that now, Internet is almost synonymous to news on the web.
Which is only a very small part of the Internet. Which is only a very small part of the Internet.
Consuming news via a social network platform makes you a lot more passive. Consuming news via a social networks makes you a lot more passive.
I can remember being a lot more active to consume the Internet content I can remember being a lot more active on the Internet just a few years
years ago. ago.
This is something to keep in mind I think. This is something to keep in mind I think.
I'll certainly write an article about that in the future.
#+end_quote #+end_quote
So my entry point to news consumption are: Here is how I consume Internet content now.
** News
:PROPERTIES:
:CUSTOM_ID: news
:END:
My entry point to news consumption are:
- highly selected RSS sources (for example HN posts with > 500 upvotes) - highly selected RSS sources (for example HN posts with > 500 upvotes)
- [[https://lobste.rs][lobste.rs]] - [[https://lobste.rs][lobste.rs]]
@ -199,20 +208,24 @@ I plan on generating RSS from those different sources with "smart filters".
Typically number of upvote filters for lobste.rs, laarc.io, sub-reddits, Typically number of upvote filters for lobste.rs, laarc.io, sub-reddits,
but also number of bookmarks in popular pinboard, etc... but also number of bookmarks in popular pinboard, etc...
I use [[https://github.com/skeeto/elfeed][elfeed]] inside Spacemacs. My preferred /Internet consumption environment/ is elfeed[fn:elfeed] inside Spacemacs.
I really enjoy staying inside emacs as much as I can. I really enjoy staying inside emacs as much as I can.
This is a clean, dense, text-oriented environment. This is a clean, dense, text-oriented environment.
I also use [[https://github.com/remyhonig/elfeed-org][elfeed-org]] to organize my feeds and I also take care to remove I also use elfeed-org[fn:elfeed-org] to organize my feeds and I also take care to remove
feeds with too much volume. feeds with too much volume.
Generally we shouldn't read more than a few articles a day. Generally we shouldn't read more than a few articles a day.
[fn:elfeed] https://github.com/skeeto/elfeed
[fn:spacemacs] http://spacemacs.org
[fn:elfeed-org] https://github.com/remyhonig/elfeed-org
** Mail ** Mail
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: mail :CUSTOM_ID: mail
:END: :END:
Most of my notifications go through my email. Most of my notifications go through my email.
Social network notifications are moved inside folder and are not directly Social network notifications are moved inside a dedicated folder and are
present in my inbox. not directly present in my inbox.
I check my social notifications once in a while. I check my social notifications once in a while.
So if you are waiting for an answer, sorry for the late reply, it might So if you are waiting for an answer, sorry for the late reply, it might
take a while. take a while.
@ -229,21 +242,21 @@ So even for Github, I can take a few days to react.
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: conclusion :CUSTOM_ID: conclusion
:END: :END:
So I described how while still using centralized social media platform, I I described how I control my usage of social networks.
still own my data, I protect myself from new attention grabbing features I own my data.
and design / UX pattern changes in those platforms. I am a lot less exposed to attention grabbing techniques.
Mostly, I take the positive aspect of those platform while not paying most For now I'm quite happy with the system I made, and I'll certainly improve
of the negative price. it in the future by synchronizing more and more services between a
self-hosted one and a social-network one.
For now my system is quite tailored made, and adapted to me. I really advice anyone with sufficient tehcnical skills to do the same.
I think we could imagine that we could offer that to more people by having This is really worth your time.
a single, easy to create platform.
The bit sad state, is that I know there are a few system that try to make For other people, I know some platform intented to be self-hosted and here
it easy for more people to self-host, or provide self-hosting for a small to provide a bunch of services for you.
community or family. But having a self made environment also enhance greatly the experience.
But this is still reserved to technical people in my opinion. And really, self-hosting is still reserved to few people.
I think we could be inspired by espial[fn:espial] to create a simple small platform to I think we could be inspired by espial[fn:espial] to create a simple small platform to
provide those feature to most people. provide those feature to most people.
@ -252,28 +265,42 @@ provide those feature to most people.
- ability to publish securely private info to a small group of friends and family - ability to publish securely private info to a small group of friends and family
- generate RSS for different group of peoples - generate RSS for different group of peoples
I would personally prefer that to a Federation platform (like Mastodon). ** Federation
Unfortunately the federated network mostly replicate the anti-features of twitter, Facebook, :PROPERTIES:
and other social media platforms. While I believe we should change our :CUSTOM_ID: federation
consumption habit. :END:
RSS is already a great tool for that. I think I can say a few word about federated networks like Mastodon, but
somehow, mastodon replicate the anti-features promoted by twitter or
Facebook.
Also there are some details I don't really like about the federation
foundations (ActivityPub).
Also, for example, I wrote a commenting system that I could easily
self-host.
I intended to use it for my blog.
But after a second though, I'm not sure comments are that positive.
I prefer to edit my article with comment people send me via other
communication channel, typically, my mail.
** Anti-features ** Anti-features
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: anti-features :CUSTOM_ID: anti-features
:END: :END:
A last note about anti-features used by social media platforms. A last note about anti-features.
Those are anti-features, as they provide almost no benefit for the user. I call /anti-feature/ a feature that provide very few or no benefit for the
All those anti-feature share the same pattern. user but provide a lot more benefits to the platform.
They use /spaced random reward/: Generally it is a feature just here to make you stay on the platform and
many quite talented specialist work on optimizing those.
Most anti-features share the same pattern; they use /spaced random reward/:
#+begin_notes #+begin_notes
*Spaced Random Reward* *Spaced Random Reward*
Typically the few first random gifts in a new Typically the few first random gifts in a new downloaded game.
downloaded game.
The main way used to /hack/ your brain, is by giving it something he likes The main way used to /hack/ your brain, is by giving it something he likes
at a random time. at a random time.
Then you start to give reward with lower and lower probability. Then you start to give reward with lower and lower probability.