开发者

Stripping Html tags from Rss feeds using Feedzilla

I cant seem to find info anywhere on how to strip html tags from the summary/title/etc fields of rss feeds using Feedzirra.

Here is my code:

# Get feed details
feed = Feedzirra::Feed.fetch_and_parse(rssUrl)

  feed.entries.each do |entry|

    logger.debug("ENTRY.SummaryWithHtmlTa开发者_如何学JAVAgs = #{entry.summary}")

  end

Any ideas how to strip the html tags from fields?


I'm learning so maybe I'm missing something but can't you do this?

include ActionView::Helpers::SanitizeHelper

# Get feed details
feed = Feedzirra::Feed.fetch_and_parse(rssUrl)

  feed.entries.each do |entry|
    stripped_summary = strip_tags(entry.summary)
    logger.debug("ENTRY.SummaryWithHtmlTags = #{stripped_summary}")

  end
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜