Validating RSS Feeds in RailsFeedValidator is a gem which validates the RSS feeds through SOAP protocol of the W3C FeedVal...
site_url = params[:feed][:title].sub(/(/)+$/,)    begin       v = W3C::FeedValidator.new       if v.validate_url(site_url)...
Upcoming SlideShare
Loading in...5
×

Validating rss feeds in rails

411

Published on

FeedValidator is a gem which validates the RSS feeds through SOAP protocol of the W3C Feed Validation service.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
411
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Validating rss feeds in rails

  1. 1. Validating RSS Feeds in RailsFeedValidator is a gem which validates the RSS feeds through SOAP protocol of the W3C FeedValidation service. It helps to find out errors in RSS or ATOM feeds. In Rails app we can do thefeed validation by installing the gem.Step#1Install the FeedValidator as a gem: gem feedvalidatorRun the bundler to install the gemStep#2Include the require feed_validator into your controllerStep#3Generate a migration file and edit the file to add the following fields class CreateFeeds < ActiveRecord::Migration def self.up create_table :feeds do |t| t.string :title t.timestamps end end def self.down drop_table :feeds end endStep#4Validate your feed URL in your controller def create
  2. 2. site_url = params[:feed][:title].sub(/(/)+$/,) begin v = W3C::FeedValidator.new if v.validate_url(site_url) && v.valid? @feed = Feed.new(:title => site_url) @feed.save end rescue # Do nothing end redirect_to request.referrerend

×