Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make the bookmark a little more printer friendly.

I've stolen the layout template from
https://github.com/freerange/printer-mail, which is based on the
[sample](http://printer.gofreerange.com/sample.html).
  • Loading branch information...
commit 0ba53664fc3cfa091567ef678cad0211811acb8e 1 parent 68496e1
@chrisroos chrisroos authored
Showing with 23 additions and 12 deletions.
  1. +9 −1 NOTES.md
  2. +5 −11 templates/bookmark.haml
  3. +9 −0 templates/layout.haml
View
10 NOTES.md
@@ -10,4 +10,12 @@ I used cURL to download an amazon book page so that I could play around with ext
After playing around a little I was able to create a script (generate-bookmark.rb) that took the URL of an Amazon book page, or the location of a local file, and emit the html of a simple bookmark.
-The next step is to create a simple web interface that allows the bookmarks to be generated and, finally, printed.
+ ./generate-bookmark.rb "http://www.amazon.co.uk/Vanishing-Point-Danielle-Ramsay/dp/1847562337/ref=tmm_pap_title_0"
+
+The next step is to create a simple web interface that allows the bookmarks to be generated and, finally, printed.
+
+I've now got my sinatra app that allows me to dynamically generate bookmarks for a given Amazon page, e.g. http://printer-bookmarks.dev/bookmark?url=http://www.amazon.co.uk/gp/product/1849014752/ref=s9_simh_gw_p14_d0_g14_i4?pf_rd_m=A3P5ROKL5A1OLE&pf_rd_s=center-2&pf_rd_r=1JDCZ1FRTRETGVAZZ5XX&pf_rd_t=101&pf_rd_p=467128533&pf_rd_i=468294
+
+I've also got the app deployed to heroku at http://printer-bookmarks.heroku.com/
+
+Now I need to make the bookmark a little more printer friendly.
View
16 templates/bookmark.haml
@@ -1,11 +1,5 @@
-!!! 5
-
-%html
- %head
- %title Bookmark
- %body
- %img#cover-image{:src => book.cover_image_url}
- %h1#book-title= book.title
- %p Started:
- %p Finished:
- %p Notes
+%img#cover-image{:src => book.cover_image_url}
+%h1#book-title= book.title
+%p Started:
+%p Finished:
+%p Notes
View
9 templates/layout.haml
@@ -0,0 +1,9 @@
+!!! 5
+
+%html
+ %head
+ %link{:rel => "stylesheet", :href => "http://printer.gofreerange.com/stylesheets/print.css", :type => "text/css", :media => "screen", :charset => "utf-8"}
+ %body.preview
+ .paper
+ .content
+ = yield
Please sign in to comment.
Something went wrong with that request. Please try again.