Subject: Re: Get title from URL?
From: Rdiger Brahns <ruedi brahns-tierleben.de>
Date: Mon, 27 Apr 2009 21:05:04 +0900
References: 334871
In-reply-to: 334871
Cisco Ri schrieb:
> Anybody have a code snippet that extracts the title from the <title> tag
> from a given URL?
Without installing special things:
require 'open-uri'
open('http://google.com/').read =~ /<title>(.*?)<\/title>/
p $1