groovy Ip地址表达式

 

currentIp = ( "http://whatsmyip.us/" .toURL().text =~ /\b\d{ 1 , 3 }\.\d{ 1 , 3 }\.\d{ 1 , 3 }\.\d{ 1 , 3 }\b/)[ 0 ]
 
println currentIp
 
def ipLog = new File( "ip-log.txt" )
 
recentIp = ipLog.readLines().last(). tokenize ( "," ).last().trim()
 
if (currentIp != recentIp) {
   Mailer.deliverIpAddressChangeMessage currentIp
   println "IP Address has changed, it is now: ${currentIp}. Sending Message."
padding-top: 0px !important; padding-right: 1em !important; padding-bottom: 0px !important; padding-left: 1em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-color: white !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-wid
分享到:
评论

你可能感兴趣的:(html,groovy)