Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def x(s: Any) = {
- println(s)
- s match {
- case "Philosophy" => 1;
- case _ => x(("<p>.*?\"/wiki/([^:]*?)\".*?</p>").r.findFirstMatchIn(scala.io.Source.fromURL("http://en.wikipedia.org/wiki/" + s).getLines.mkString).map(_ group 1).mkString) + 1
- }
- }
- println(x(args(0)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement