Sha256: 7ccd72fa2ac893378eaa6f923dac5957ab29d1c69df409847c7a597952dd2194

Contents?: true

Size: 814 Bytes

Versions: 2

Compression:

Stored size: 814 Bytes

Contents

class PagesController < ActionController::Base
  skip_before_filter :authenticate_user!

  def updates
  	require 'open-uri'
    require 'nokogiri'

    @posts = []
    doc = Nokogiri::HTML(open('http://www.fracturedatlas.org/site/blog/tag/artfully/'))

    begin
      doc.css('.post').each do |post|
        content = {}
        content[:title] = post.css('h2').first.content
        content[:link] = post.css('h2 a').first['href']
        content[:byline] = post.css('.byline').first.content
        content[:entry] = post.css('.entry').first.content
        @posts << content
      end
    rescue
      logger.info "Pulling in updates from the FA blog on index#updates failed."
      # todo: send to airbrake or exceptional
    end
  end

  def sign_up_form
    render :sign_up_form, :layout => false
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
artfully_ose-1.0.0.rc4 app/controllers/pages_controller.rb
artfully_ose-1.0.0.rc3 app/controllers/pages_controller.rb