Fork me on GitHub
#babashka
<
2024-02-17
>
naxels13:02:47

Hi all! Any idea how I can use Hickory (https://github.com/clj-commons/hickory) with Babashka? I see a bb.edn but that seems to be a helper for running tests

naxels13:02:15

i’m trying to parse an RSS XML feed which contains HTML data and want to parse that as well and get all a href’s for futher processing

naxels13:02:23

the error I get is: 5: (:import [org.jsoup Jsoup] ^--- Unable to resolve classname: org.jsoup.Jsoup 6: [org.jsoup.nodes Attribute Attributes Comment DataNode Document 7: DocumentType Element TextNode XmlDeclaration] 8: [org.jsoup.parser Tag Parser])) which is understandable as it isn’t mentioned anywhere in the BB docs but maybe there is some easy thing I can do to add it?

borkdude13:02:47

Please use a thread for discussing 1 and the same topic, especially when posting code

borkdude13:02:18

hickory isn't compatible with babashka because it uses the Jsoup Java library which isn't part of bb

naxels13:02:32

Yeah i figured 😞 any recommendations for my goal? I really like the bb speed and this will execute as multiple scripts on a Linux server

borkdude13:02:52

what is your goal

naxels13:02:22

sorry haven’t used Slack in a while, didn’t recall how to create thread

naxels13:02:29

i'm trying to parse an RSS XML feed which contains HTML data and want to parse that as well and get all a href's for futher processing

borkdude13:02:41

ah sorry, I didn't read that

naxels13:02:58

i have the RSS parsing completed as clojure.data.xml is supported

borkdude13:02:59

can't you parse the HTML data as XML or isn't it xhtml?

naxels13:02:25

hmm, the RSS feed outputs an encoded:content that is a partial HTML, don’t know if it’s XHTML

naxels13:02:35

i could definitely try!

naxels13:02:50

thx i will try that!

Omer ZAK22:02:56

Is there any tutorial for building a Babashka pod based upon a Clojure script, with the goal of making libraries required by it available to a Babashka script? The only simple example I saw in https://github.com/babashka/pods/tree/master/examples uses a Python script, rather than a Clojure script. I love Python, however it does not directly help me require Clojure libraries and make them available for use in a Babashka script.

borkdude22:02:00

Any Clojure example in this repo can serve as an example, together with the pods documentation: https://github.com/babashka/pod-registry

Omer ZAK22:02:12

Which of those Clojure examples in the repo is sufficiently simple to be good for a tutorial?

borkdude22:02:34

probably the clj-kondo one, it isn't that large in scope

nate15:02:46

I created a library that can help make pods called https://github.com/justone/bb-pod-racer. I use it in the two pods linked from the readme.

wow 1
Omer ZAK17:02:23

@U0510902N, what resources did you use to master the art of building Babashka pods?

Omer ZAK08:02:04

Answering myself, I found that the README file in https://github.com/babashka/pods is a good resource.

👍 2
nate19:02:21

Yes, that readme is a great resource. I ended up reading other pod source to see how things were implemented (for the protocol), and I studied babashka's (and other's) build tooling to learn how to Graal-compile into binaries.

Omer ZAK01:02:27

@U04V15CAJ @U0510902N Given that I want to create a Babashka pod (which exposes the functions and variables defined in a Clojure script): Can you please provide me with pointers to information about setting up the build environment for this? What I did so far was to search among Leiningen templates (in https://clj-templates.com/ ) and find that there is nothing for starting a Babashka pod project or for building stuff for GraalVM.

borkdude07:02:18

Copy an existing project and modify it?

Omer ZAK10:02:13

I considered copying an existing project, but saw that there are several extraneous files - CI stuff etc. Since CI will eventually be needed, I'll accept your suggestion.

nate18:02:13

I agree, copying an existing project is a good way to go. I don't know of any templates to use, so starting off with something that works is best.