<commit_before>require 'rss'

class StaticPagesController < ApplicationController
  
  layout 'application', only: [:guidance]
  
  def orcid
    render(layout: nil)
  end

  def home
    @rss = Rails.cache.read('rss')
    @public_dmps = Plan.public_visibility.order("RAND()")[0..4]
    if @rss.nil?
      begin
        rss_xml = open(APP_CONFIG['rss']).read
        @rss = RSS::Parser.parse(rss_xml, false).items.first(5)
        Rails.cache.write("rss", @rss, :expires_in => 15.minutes)
      rescue Exception => e
        logger.error("Caught exception: #{e}.")
      end
    end
  end

  def about
  end
  
  def video
  end
  
  def partners
  end
<commit_msg>home page - ordering public dmps by name limit to 5<commit_after>require 'rss'

class StaticPagesController < ApplicationController
  
  layout 'application', only: [:guidance]
  
  def orcid
    render(layout: nil)
  end

  def home
    @rss = Rails.cache.read('rss')
    #@public_dmps = Plan.public_visibility.order("RAND()")[0..4]
    @public_dmps = Plan.public_visibility.order(name: :asc).limit(5)
    if @rss.nil?
      begin
        rss_xml = open(APP_CONFIG['rss']).read
        @rss = RSS::Parser.parse(rss_xml, false).items.first(5)
        Rails.cache.write("rss", @rss, :expires_in => 15.minutes)
      rescue Exception => e
        logger.error("Caught exception: #{e}.")
      end
    end
  end

  def about
  end
  
  def video
  end
  
  def partners
  end

{'fraction_non_alphanumeric': 0.1286509040333797, 'fraction_numerical': 0.008344923504867872, 'mean_word_length': 2.7571801566579635, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '6528900', 'n_tokens_mistral': 511, 'n_tokens_neox': 491, 'n_words': 112}