News for hackers. Stuff that matters.
Re:Crystal in Production: Diploid by wiremine on Saturday October 28, 2017 @11:54AM (#15575522)
Would love to hear your take on the good and bad parts of Crystal. Been toying around with it for a few small things, and been following the blog... would love to hear more input from users. :-)
Re:Crystal in Production: Diploid by nurettin on Saturday October 28, 2017 @01:50PM (#15575990)
Would love to have a nokogiri-level xpath or css3 selector capabilities. I'm up to my neck with projects, but this looks like a good start: https://github.com/jgehring/hcxselect/tree/83d3edaa8a6944d20...
Re:Crystal in Production: Diploid by RX14 on Saturday October 28, 2017 @02:14PM (#15576093)
We have libxml2 bound in the stdlib with xpath support, do you need more?
Re:Crystal in Production: Diploid by nurettin on Saturday October 28, 2017 @02:22PM (#15576117)
Yes! it would take a lot of hard work to convert all my css3 selectors to xpath.
Re:Crystal in Production: Diploid by RX14 on Saturday October 28, 2017 @02:42PM (#15576199)
I think having css3 to xpath selector conversion in the stdlib (or perhaps a shard based on how complex it is)would be possible. It would be great if you could open an issue in crystal's repo.
Re:Crystal in Production: Diploid by ricardobeat on Saturday October 28, 2017 @03:41PM (#15576468)
This shard implements a CSS selector API on top of an html parser: https://github.com/kostya/modest
Re:Crystal in Production: Diploid by RX14 on Saturday October 28, 2017 @04:12PM (#15576578)
If only it was compatible with the existing XML interface...
Re:Crystal in Production: Diploid by ricardobeat on Sunday October 29, 2017 @08:31AM (#15579061)
XML has way more surface area than HTML, you could only query a small subset of valid XML documents with CSS. Plus, these days nobody uses XML parsers for HTML anymore, their behavior has diverged; things like behaviour of unclosed elements, valid children tags, are defined in the HTML spec and not possible in XML.