Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Validation for feed links using by 'rss'

Reply
Thread Tools

Validation for feed links using by 'rss'

 
 
Swapna Ch
Guest
Posts: n/a
 
      05-21-2010
Hi all,


I used require 'rss'.
got the feeds in links what i gave in the link field.

but i want to validate the link is corect url/uri or not.

Please reply to me
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Swapna Ch
Guest
Posts: n/a
 
      05-22-2010
saurabh purnaye wrote:
> Hi,
> There are ways to validate url
>
> 1. validate using reg ex
>
> /(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/ix
>
> 2. Ping the url using 'net/http'
>
>
>
> --
> Thanks and Regards
> Saurabh Purnaye
> +91-9922071155
> skype: sorab_pune
> yahoo & gtalk: saurabh.purnaye
> msn:
> --
> please don't print this e-mail unless you really need to.



Thanx for replying
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Lars Haugseth
Guest
Posts: n/a
 
      05-31-2010
* saurabh purnaye <> wrote:
>
> [Note: parts of this message were removed to make it a legal post.]
>
> Hi,
> There are ways to validate url
>
> 1. validate using reg ex
>
> /(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/ix


Why not use the standard library?

require 'uri'

begin
uri = URI.parse(url_string)
rescue URI::InvalidURIError
puts "Bad URL: #{url_string}"
end

--
Lars Haugseth
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Feed validation problem mherzber XML 0 02-02-2008 05:54 PM
How do you get feed discovery to work? I go to web pages I know has feeds, but the feed discovery button is disabled. Help! Tim Bryant Computer Support 1 02-13-2007 05:01 AM
Feed Validation Issue thehuby@gmail.com XML 2 12-26-2006 09:59 AM
Using both server side validation and client side validation =?Utf-8?B?dmlkeWE=?= ASP .Net 1 06-02-2005 09:45 PM
Using Summary Validation control with server Custom validation =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?= ASP .Net 2 10-15-2004 06:15 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57