Fork me on GitHub
#babashka
<
2021-03-22
>
borkdude10:03:45

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

borkdude14:03:54

@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 ;)

borkdude14:03:21

e.g. bb :clean:build

grazfather14:03:31

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

borkdude14:03:07

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

grazfather14:03:18

it’s a reasonable restriction

Max14:03:17

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!

borkdude14:03:03

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

Max14:03:32

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

borkdude14:03:00

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

borkdude14:03:21

maybe the docs could do a better job of highlighting that

borkdude14:03:03

Thanks for your feedback

Max15:03:02

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

Max15:03:41

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?)

borkdude15:03:35

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 :)

Max15:03:52

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

Crispin15:03:36

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

Crispin15:03:27

standard clojure tools like walk and zippers also have their place

Tomas Brejla08:03:24

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 Brejla08:03:25

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/

borkdude08:03:07

Cool :) I posted these notes into the arm issue

👏 3