If you pass this AppleScript a URL it should return the title of the page...
on run {input, parameters}
set pageTitle to do shell script "curl " & quoted form of (first item of input) & " | grep -o \\<title\\>.*\\</title\\> | sed -E 's/<\\/?title>//g'"
return pageTitle
end run