<commit_before>require 'sinatra'
require_relative 'lib/hedbergism/quote_file'

file_name = File.join(File.dirname(__FILE__), 'bin/quotes.csv')
quotes = Hedbergism::QuoteFile.new(file_name)
title = "Hedbergism - A single, random quote from <NAME>"

get '/' do
  #content_type :txt
 
  quote, index = quotes.random
  
	permalink = "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}/#{index}"
  
  haml :index, :locals => {:quote => quote, :permalink => permalink, :title => title}
end

get '/:id' do |id|
  quote = quotes.line(id.to_i)
  
  haml :index, :locals => {:quote => quote, :permalink => permalink, :title => title}
end

get '/channel.html' do
  File.read(File.join('public', 'channel.html'))
end

__END__
@@layout
!!! 5
%html
  %head
    %meta(charset="utf-8")
    %title #{locals[:title]}
    %script(type="text/javascript"
            src="/js/ga.js")
    %link(rel="stylesheet" type="text/css" href="/css/styles-nobgimage.css")
    %meta{:name => "og:title", :content => "#{locals[:title]}" } 
    %meta{:name => "og:type", :content => "website" }
    %meta{:name => "og:image", :content => "/images/icon.jpeg" }
    %meta{:name => "og:url", :content => "http://www.hedbergism.com" }
    %meta{:name => "og:site_name", :content => "Hedbergism" }
    %meta{:name => "fb:app_id", :content => "407537325948061" }
    %meta{:name => "og:description", :content => "#{locals[:quote]}" }
  %body
  %div#fb-root
  :javascript
    window.fbAsyncInit = function() {
      FB.init({
        appId      : 'hedbergism', // App ID
        channelUrl : '//www.hedbergism.com/channel.html', // Channel File
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        xfbml      : true  // parse XFBML
      });
      // Additional initialization code here
    };

    // Load the SDK Asynchronously
    (function(d){
      var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
      if (d.getElementById(id)) {return;}<commit_msg>Quick test for og:description<commit_after>require 'sinatra'
require_relative 'lib/hedbergism/quote_file'

file_name = File.join(File.dirname(__FILE__), 'bin/quotes.csv')
quotes = Hedbergism::QuoteFile.new(file_name)
title = "Hedbergism - A single, random quote from <NAME>"

get '/' do
  #content_type :txt
 
  quote, index = quotes.random
  
	permalink = "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}/#{index}"
  
  haml :index, :locals => {:quote => quote, :permalink => permalink, :title => title}
end

get '/:id' do |id|
  quote = quotes.line(id.to_i)
  
  haml :index, :locals => {:quote => quote, :permalink => permalink, :title => title}
end

get '/channel.html' do
  File.read(File.join('public', 'channel.html'))
end

__END__
@@layout
!!! 5
%html
  %head
    %meta(charset="utf-8")
    %title #{locals[:title]}
    %script(type="text/javascript"
            src="/js/ga.js")
    %link(rel="stylesheet" type="text/css" href="/css/styles-nobgimage.css")
    %meta{:name => "og:title", :content => "#{locals[:title]}" } 
    %meta{:name => "og:type", :content => "website" }
    %meta{:name => "og:image", :content => "/images/icon.jpeg" }
    %meta{:name => "og:url", :content => "http://www.hedbergism.com" }
    %meta{:name => "og:site_name", :content => "Hedbergism" }
    %meta{:name => "fb:app_id", :content => "407537325948061" }
    %meta{:property => "og:description", :content => "#{locals[:quote]}" }
  %body
  %div#fb-root
  :javascript
    window.fbAsyncInit = function() {
      FB.init({
        appId      : 'hedbergism', // App ID
        channelUrl : '//www.hedbergism.com/channel.html', // Channel File
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        xfbml      : true  // parse XFBML
      });
      // Additional initialization code here
    };

    // Load the SDK Asynchronously
    (function(d){
      var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
      if (d.getElementById(id)) {return;}
{'fraction_non_alphanumeric': 0.18826108134437408, 'fraction_numerical': 0.00876765708718948, 'mean_word_length': 3.314075630252101, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '3126318', 'n_tokens_mistral': 1476, 'n_tokens_neox': 1433, 'n_words': 306}