progs/crawler3.scala
changeset 329 dbba38a5c2ae
parent 254 dcd4688690ce
child 399 5c1fbb39c93e
equal deleted inserted replaced
328:bc03ff3d347c 329:dbba38a5c2ae
    10     { println(s"  Problem with: $url"); ""}
    10     { println(s"  Problem with: $url"); ""}
    11 }
    11 }
    12 
    12 
    13 // regexes for URLs, for "my" domain and for email addresses
    13 // regexes for URLs, for "my" domain and for email addresses
    14 val http_pattern = """"https?://[^"]*"""".r
    14 val http_pattern = """"https?://[^"]*"""".r
    15 val my_urls = """urbanc""".r
       
    16 val email_pattern = """([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})""".r
    15 val email_pattern = """([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})""".r
    17 
    16 
    18 def unquote(s: String) = s.drop(1).dropRight(1)
    17 def unquote(s: String) = s.drop(1).dropRight(1)
    19 
    18 
    20 def get_all_URLs(page: String) : Set[String] = 
    19 def get_all_URLs(page: String) : Set[String] =