Knowledge Base

September 4, 2007

Get the title of the given url using ruby

Filed under: Technical — rkutti @ 12:59 pm

We can use the following ruby code snippets to get the title of given url:

require ‘open-uri’

f = open(“http://www.google.com”)

a = f.read

s = a.split(“title>”)

url = s[1]

results in:

Google

1 Comment »

  1. Hey gr888 work!!!!!!!

    Comment by Radha — October 16, 2007 @ 1:46 pm


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.