Skip to content

Instantly share code, notes, and snippets.

@maxjacobson
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxjacobson/9244b99019d4fad3832f to your computer and use it in GitHub Desktop.
Save maxjacobson/9244b99019d4fad3832f to your computer and use it in GitHub Desktop.
# first run: gem install sinatra film_snob
# then run ruby film_snob_sinatra.rb
# then visit http://localhost:4567
require 'sinatra'
require 'film_snob'
get '/' do
@url = params[:url]
@film = FilmSnob.new(@url)
erb :home
end
__END__
@@home
<% if @film.watchable? %>
<%= @film.html %>
<% end %>
<form action='/'>
<input type='text' name='url' value='<%= @url %>' />
<input type='submit' />
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment