daociyiyou
2009-Apr-16  18:03 UTC
how to get the enclosure'' url value when reading the rss feed
how to get the enclosure'' url value when reading the rss feed? I
define a help method to judge if there is a enclosure in a rss
item,and use it in a view,the codes are following:
########
module EncodeHelper
    def enclosure?(item)
     if item.to_s.scan("<enclosure").length > 0
      return true
     else
      return false
     end
    end
end
#########
the view codes:
<%if enclosure?(item)-%>
        <tr>
         <th>Download:<th>
         <td>
           <%=item.enclosure.url-%>
         <td>
        </tr>
 <%end-%>
##########
I got nothing about enclosure''s url value and display,but indeed,there
are enclosure tag in the rss page source code (http://drop.io/
eupdibcj58n5ywbpuzwa/0d231f619d5e84fd1f4c3ab90465915f5e5e665f/
showreelfinder.rss).
How to manage it? Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
daociyiyou
2009-Apr-17  00:46 UTC
Re: how to get the enclosure'' url value when reading the rss feed
how to get enclosure tag attr value? On Apr 17, 2:03 am, daociyiyou <chey...-/E1597aS9LRv1O+Z8WTAqQ@public.gmane.org> wrote:> how to get the enclosure'' url value when reading the rss feed? I > define a help method to judge if there is a enclosure in a rss > item,and use it in a view,the codes are following: > ######## > module EncodeHelper > def enclosure?(item) > if item.to_s.scan("<enclosure").length > 0 > return true > else > return false > end > end > end > ######### > the view codes: > <%if enclosure?(item)-%> > <tr> > <th>Download:<th> > <td> > <%=item.enclosure.url-%> > <td> > </tr> > <%end-%> > ########## > I got nothing about enclosure''s url value and display,but indeed,there > are enclosure tag in the rss page source code (http://drop.io/ > eupdibcj58n5ywbpuzwa/0d231f619d5e84fd1f4c3ab90465915f5e5e665f/ > showreelfinder.rss). > How to manage it? Thanks!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
daociyiyou
2009-Apr-17  04:02 UTC
Re: how to get the enclosure'' url value when reading the rss feed
I have searched via google,It seems there is not a perfect tutorial abou this On Apr 17, 8:46 am, daociyiyou <chey...-/E1597aS9LRv1O+Z8WTAqQ@public.gmane.org> wrote:> how to get enclosure tag attr value? > > On Apr 17, 2:03 am, daociyiyou <chey...-/E1597aS9LRv1O+Z8WTAqQ@public.gmane.org> wrote: > > > how to get the enclosure'' url value when reading the rss feed? I > > define a help method to judge if there is a enclosure in a rss > > item,and use it in a view,the codes are following: > > ######## > > module EncodeHelper > > def enclosure?(item) > > if item.to_s.scan("<enclosure").length > 0 > > return true > > else > > return false > > end > > end > > end > > ######### > > the view codes: > > <%if enclosure?(item)-%> > > <tr> > > <th>Download:<th> > > <td> > > <%=item.enclosure.url-%> > > <td> > > </tr> > > <%end-%> > > ########## > > I got nothing about enclosure''s url value and display,but indeed,there > > are enclosure tag in the rss page source code (http://drop.io/ > > eupdibcj58n5ywbpuzwa/0d231f619d5e84fd1f4c3ab90465915f5e5e665f/ > > showreelfinder.rss). > > How to manage it? Thanks!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---