babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
borkdude 2021-03-22T10:18:45.139200Z

Updated the "task runner" issue with a problem statement and a proposed solution. https://github.com/babashka/babashka/issues/756

borkdude 2021-03-22T14:40:54.140500Z

@grazfather fyi, lread and I came up with a shortcut for bb :do :foo :and-do :bar:

bb :foo:bar
Pretty obvious if you think about it ;)

borkdude 2021-03-22T14:41:21.141200Z

e.g. bb :clean:build

grazfather 2021-03-22T14:41:31.141500Z

haha yep. That makes sense. As long as a task doesn’t have : in its name

grazfather 2021-03-22T14:41:35.141700Z

i like it

borkdude 2021-03-22T14:43:07.142400Z

I think we will just discourage this as non-supported (colons in names)

grazfather 2021-03-22T14:43:13.142600Z

i agree

grazfather 2021-03-22T14:43:18.142900Z

it’s a reasonable restriction

Max 2021-03-22T14:46:17.145Z

Single-data-point-but-possibly-interesting case study from today: I wanted to use babashka for a quick scraping task, but couldn’t because there’s no JSoup pod (or any other HTML parser libs). I didn’t have time to build the pod and ended up going back to Python. On the other hand, babashka.curl was great!

borkdude 2021-03-22T14:49:03.145400Z

@max.r.rothman There is a pod for this actually, it's called bootleg.

Max 2021-03-22T14:51:32.146600Z

ah, I see, it includes enlive. I glossed over it because the description talks about generating html, not parsing it

borkdude 2021-03-22T14:53:00.147Z

you can just do (utils/convert-to <string> :hiccup) and it will parse HTML

borkdude 2021-03-22T14:53:21.147400Z

maybe the docs could do a better job of highlighting that

borkdude 2021-03-22T14:53:39.147600Z

cc @retrogradeorbit

👍 1
borkdude 2021-03-22T14:55:03.147900Z

Thanks for your feedback

Max 2021-03-22T15:00:02.148800Z

Thanks for thanking me! I’m always impressed with how well the bb community handles feedback

Max 2021-03-22T15:01:41.150700Z

Slightly off topic, but it seems like there’s lots of clojure tools for parsing html into hiccup/hickory/whatever, but not many for efficiently extracting data from the tag soup. JSoup at least has CSS selector support, but most of the wrapper libraries seem to hide that. So I probably would’ve ended up still going back to python in this case (unless there’s another feature I’m missing?)

borkdude 2021-03-22T15:02:35.151300Z

Yeah not sure, maybe there is something in bootleg that can do this. If startup isn't important, you could also just use JSoup on the JVM :)

Max 2021-03-22T15:13:52.151900Z

I almost just broke out full-jvm-clojure before reverting to python 🙂

Crispin 2021-03-22T15:25:36.152900Z

hickory (also included in bootleg) is good for data extraction. enlive is better for transformation

Crispin 2021-03-22T15:27:27.153900Z

standard clojure tools like walk and zippers also have their place

Crispin 2021-03-22T15:30:56.155500Z

https://github.com/davidsantiago/hickory#selectors

borkdude 2021-03-22T18:59:17.155900Z

https://twitter.com/brdloush/status/1374072323834265601 ❤️

3
❤️ 7
1
Tomas Brejla 2021-03-23T08:12:24.157100Z

FYI that M2-801W tablet is running rather ancient Android 6. Simple installation of termux app from google play and copying statically compiled bbwas enough to get it running. For newer androids, (I have Xiaomi MI8 phone with Android 11 10) , it might be a bit more problematic due to newly introduced changes in security. Yet, in the end, I was able to run bb even on that phone. All I had to additionally do was to to install proot package (`apt install proot`) and then execute termux-chroot script before actually trying to run bb . Without these adjustments, bb wouldn't start on this device. It's wonderful what can be achieved (and in relatively easy way) these days. I wonder what use-case scenarios people will come with. Having the ability to run full-blown bb in that powerful device resting in your pocket, may spark many new ideas.

Tomas Brejla 2021-03-23T08:20:25.157300Z

Althought it should be noted that Termux's position is rather complicated these days, as explained in this article https://www.xda-developers.com/termux-terminal-linux-google-play-updates-stopped/

borkdude 2021-03-23T08:40:07.157600Z

Cool :) I posted these notes into the arm issue

👏 1