Skip to content

Instantly share code, notes, and snippets.

View pratos's full-sized avatar
🎯
Focusing

prthamesh pratos

🎯
Focusing
View GitHub Profile
@pratos
pratos / meeseeks.ex
Created September 27, 2020 11:05
Meeseeks <link> tag problem
import Meeseeks.XPath
HTTPoison.start()
{:ok, response} = HTTPoison.get("feeds.megaphone.fm/tamc1029044713")
doc = Meeseeks.parse(response.body)
[first, second | rest] = Meeseeks.all(doc, xpath("item"))
IO.puts Meeseeks.tree(first)
IO.puts Meeseeks.all(doc, xpath("item//link"))
IO.puts Meeseeks.all(doc, xpath("item//link/text()")) |> Enum.map(&Meeseeks.text/1)