html

fpsimplified.com alvin October 12, 2018 - 1:20pm

To make the online reading a little easier, I’ve put a free preview version of Functional Programming, Simplified on fpsimplified.com. That website contains ~40 lessons from the book. For more complete previews, see my original Functional Programming, Simplified page.

A Scala shell script to insert text before a matching pattern

I don’t remember exactly why I wrote this Scala shell script, but if I remember right I was having a problem getting sed to work properly, so I wrote this little script to insert an Amazon Kindle “break” tag before each <h1> tag in an HTML file:

A Scala “Word of the day” shell script alvin February 5, 2018 - 3:39pm

I have a 19" monitor on the counter between my kitchen and living room, and it’s powered by a Raspberry Pi. I use the Linux Phosphor screen saver to show a scrolling “news and stock ticker” on the display, which I’ve programmed to show news from several different sources (Atom and Rss feeds, along with other news and data sources). An old version of the display looks like this:

My Raspberry Pi news ticker display

Today I added a new “Word of the day” feature to the display, and as with all of the other code, I wrote a Scala shell script to generate the output.

Examples of converting HTML to plain text with Scala and Jsoup alvin January 27, 2018 - 8:57am

If you ever need to convert HTML to plain text using Scala or Java, I hope these Jsoup examples are helpful:

A Scala shell script to read HTML H1 tag attributes alvin October 20, 2017 - 3:14am

I’m putting this Scala shell script out here as a “source code snippet” so I can find it again if I need it. This file reads an input file that contains a series of HTML <h1> tags. I use this as part of a process of publishing an Amazon Kindle ebook from an HTML file, and in one of the steps of the creation process, I use this script to help create the Table of Contents (TOC) for the book.

Here’s the source code: