<commit_before>class FeedsController < ApplicationController
  before_action :set_feed, only: [:show, :show_feedly, :edit, :update, :destroy]
  before_action :set_topic, only: [:index]
  before_action :require_admin, only: [:new, :create, :destroy, :update]

  def index
    @title = 'Feeds'
    if @topic.present?
      @feeds = @topic.feeds.order('velocity DESC')
    else
      @feeds = Feed.all.order('velocity DESC')
    end
    @subscriptions = Subscription.where(user_id: current_user.id)
  end

  def show
  end

  def show_feedly
    client = Feedlr::Client.new
    @feedlr_feed = client.feed(@feed.id)
  end

  def new
    @feed = Feed.new
  end

  def create
    @feed = Feed.find_or_create_with_ids(["feed/#{feed_params[:id]}"]).first
    respond_to do |format|
      if @feed.nil?
        @feed = Feed.new
        flash[:notice] = 'The url is invalid'<commit_msg>Force to render html for feed detail page<commit_after>class FeedsController < ApplicationController
  before_action :set_feed, only: [:show, :show_feedly, :edit, :update, :destroy]
  before_action :set_topic, only: [:index]
  before_action :require_admin, only: [:new, :create, :destroy, :update]

  def index
    @title = 'Feeds'
    if @topic.present?
      @feeds = @topic.feeds.order('velocity DESC')
    else
      @feeds = Feed.all.order('velocity DESC')
    end
    @subscriptions = Subscription.where(user_id: current_user.id)
  end

  def show
    render action: "show", formats: :html
  end

  def show_feedly
    client = Feedlr::Client.new
    @feedlr_feed = client.feed(@feed.id)
  end

  def new
    @feed = Feed.new
  end

  def create
    @feed = Feed.find_or_create_with_ids(["feed/#{feed_params[:id]}"]).first
    respond_to do |format|
      if @feed.nil?
        @feed = Feed.new
        flash[:notice] = 'The url is invalid'
{'fraction_non_alphanumeric': 0.12623490669593854, 'fraction_numerical': 0.0, 'mean_word_length': 3.371702637889688, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7301563', 'n_tokens_mistral': 648, 'n_tokens_neox': 623, 'n_words': 153}