require 'rubygems' require 'json' class IdFeed < ComboFeed def initialize( link, token=nil, regex=nil ) super( link, token, "^Id:(.*)" ) @recipes ={} if( File.file?( "recipes.dat" ) ) json = IO.read( "recipes.dat" ) @recipes = JSON.parse( json ) end end def buildFeed( date ) # get recipe r = @recipes[match[1]] # parse recipe parse( r ) # build recipe super( date ) end def title if( match != nil ) match[1] else @title end end def description if( match != nil ) match[1] else @description end end end begin $ids["Id:"] = IdFeed.method( 'new' ) end