jsoup worked well as a way to modifying HTML content using Scala alvin October 29, 2017 - 4:22pm

I’ve used HtmlCleaner many times before to read/parse HTML content, but jsoup worked well today as a way to modify HTML content using Scala.

Ward Cunningham example of recursively parsing HTML tables alvin July 19, 2015 - 1:01pm

Lately I have been thinking about writing a functional programming book, and if I decide to do that, I might include a variation of this Ward Cunningham example of how to parse HTML table tags recursively. His code is written in Java, and you can read about it here.

My Scala Apache access log parser library alvin March 12, 2014 - 12:53pm

Last week I wrote an Apache access log parser library in Scala to help me analyze my Apache HTTP access log file records using Apache Spark. The source code for that project is hosted here on Github. You can use this library to parse Apache access log “combined” records using Scala, Java, and other JVM-based programming languages.

An Android Java, JSON, and Twitter REST API example alvin March 28, 2012 - 9:55am

I don't get to parse too much JSON code with Java because the biggest JSON source I work with is Twitter, and I always use the Twitter4J project to interact with their web services. But a few days ago while working on an Android project, I just wanted to access their "Twitter Trends" REST service, and I used Java and the Java library that comes with Android to parse the Twitter Trends JSON feed like this:

Parsing “real world” HTML with Scala, HTMLCleaner, and StringEscapeUtils alvin February 3, 2012 - 8:13am

While XML parsers work great for well-formed XML, out in the 'real world' internet, you can't count on HTML being XHTML, or even being well-formatted. As a result, various 'HTML cleaner' libraries for Java have appeared. They attempt to clean up the HTML so you can parse it.

Scala YAML parser examples using Snakeyaml alvin February 2, 2012 - 10:53am

Summary: A Scala YAML parsing example using the Snakeyaml parser.

If you need some Scala YAML parsing examples using Snakeyaml parser, you've come to the right place. I just worked through some Snakeyaml issues related to Scala, in particular converting YAML to JavaBean classes written in Scala, so I thought I'd share the source code here.

A Scala JSON array parsing example using Lift-JSON alvin January 29, 2012 - 8:32am

I just worked through some Scala Lift-JSON issues, and thought I'd share some source code here.

In particular, I'm trying to parse a JSON document into Scala objects, and I'm using Lift-JSON to do so. One of the things I'm doing here is to parse some of the JSON text into an array of objects, in this case an array of String objects.

First, here's the Scala source code for my example, and then a description will follow:

A simple Scala JSON parser example using Lift-JSON alvin January 25, 2012 - 9:11am

Scala JSON FAQ: How can I parse JSON text or a JSON document with Scala?

As I continue to plug away on my computer voice control application (SARAH), last night I started working with JSON, specifically the Lift-JSON library (part of the Lift Framework), which seems to be the preferred JSON library of the Scala community.