Updated the "task runner" issue with a problem statement and a proposed solution. https://github.com/babashka/babashka/issues/756
@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 ;)e.g. bb :clean:build
haha yep. That makes sense. As long as a task doesn’t have :
in its name
i like it
I think we will just discourage this as non-supported (colons in names)
i agree
it’s a reasonable restriction
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!
@max.r.rothman There is a pod for this actually, it's called bootleg.
https://gist.github.com/borkdude/fc64444a4e7aea4eb647ce42888d1adf
https://github.com/babashka/pod-registry/blob/master/examples/bootleg.clj
ah, I see, it includes enlive. I glossed over it because the description talks about generating html, not parsing it
you can just do (utils/convert-to <string> :hiccup)
and it will parse HTML
maybe the docs could do a better job of highlighting that
Thanks for your feedback
Thanks for thanking me! I’m always impressed with how well the bb community handles feedback
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?)
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 :)
I almost just broke out full-jvm-clojure before reverting to python 🙂
hickory (also included in bootleg) is good for data extraction. enlive is better for transformation
standard clojure tools like walk and zippers also have their place
FYI that M2-801W tablet is running rather ancient Android 6. Simple installation of termux
app from google play and copying statically compiled bb
was 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.
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/
Cool :) I posted these notes into the arm issue