This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based entirely on this blog post: | |
// http://druss.co/2016/04/export-all-workouts-from-sports-tracker/ | |
// unfortunately the original script no longer works, moslty because jQuery is | |
// no longer available on sports-tracker pages. | |
// | |
// I've compiled the changes proposed in the comments in the script below. | |
// to use the script, login to your sports-tracker account | |
// change URL to http://www.sports-tracker.com/diary/workout-list | |
// open browser console (Cmd-Shift-I) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Schema2CaseClass { | |
import org.apache.spark.sql.types._ | |
case class RecFieldRes(fieldStr: String, additionalCc: Option[String] = None) | |
case class CcRes(cc: String, additional: List[String]) | |
def schema2Cc(schema: StructType, className: String): String = { | |
val res = CcRes(s"case class $className (\n", Nil) |