Last active
December 15, 2020 02:08
-
-
Save bradlindblad/1d789b40ee5e0c11f8554db474fe4d89 to your computer and use it in GitHub Desktop.
* JULIA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Cascadia, Gumbo, HTTP | |
r = HTTP.get("http://stackoverflow.com/questions/tagged/julia-lang", require_ssl_verification = false) | |
h = parsehtml(String(r.body)) | |
qs = eachmatch(Selector(".question-summary"),h.root) | |
println("StackOverflow Julia Questions (votes answered? url)") | |
for q in qs | |
votes = nodeText(eachmatch(Selector(".votes .vote-count-post "), q)[1]) | |
answered = length(eachmatch(Selector(".status.answered"), q)) > 0 | |
href = eachmatch(Selector(".question-hyperlink"), q)[1].attributes["href"] | |
println("$votes $answered http://stackoverflow.com$href") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment