Cool hacker stuff to do with SuttaCentral? redbean!

Dear Bhante, thank you for sharing this reference. I read the post and am also quite amazed by the whole Cosmopolitan Libc library which I did not know before. Unfortunately, the normal the redbean binary from the website gives me a segmentation fault (Fedora Linux), but it works well when building it locally.

I gave it a shot, uploaded the code at Sebastian K / Portable SC · GitLab and the latest build can be downloaded here (~ 117MB, all english sutta and root texts). I tested this version on Windows where it was working okay (firewall seems to complain though).

I did not use sqlite, but just scraped the same api urls (running locally) which the service worker would cache and stored them in the filesystem where the lua server just servers them directly as the filepath matches the api path. Handling the different possible query parameter combinations (especially “siteLanguage”) is a bit of a challenge, I hope I covered the most important cases.

If time permits, I will try to look into fixing issues that are currently present, multi-lingual builds and perhaps try to use sqlite to make a basic search offline.

1 Like