Skip to content

Instantly share code, notes, and snippets.

@bradlindblad
Last active December 15, 2020 02:08
Show Gist options
  • Save bradlindblad/1d789b40ee5e0c11f8554db474fe4d89 to your computer and use it in GitHub Desktop.
Save bradlindblad/1d789b40ee5e0c11f8554db474fe4d89 to your computer and use it in GitHub Desktop.
* JULIA
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