file_get_conents|curl if(preg_match ololo else trololo регулярку на нахождение ссылки найти не сложно.