Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Chris Roos authored
10  NOTES.md
Source Rendered
@@ -10,4 +10,12 @@ I used cURL to download an amazon book page so that I could play around with ext
10 10
 
11 11
 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.
12 12
 
13  
-The next step is to create a simple web interface that allows the bookmarks to be generated and, finally, printed.
  13
+    ./generate-bookmark.rb "http://www.amazon.co.uk/Vanishing-Point-Danielle-Ramsay/dp/1847562337/ref=tmm_pap_title_0"
  14
+
  15
+The next step is to create a simple web interface that allows the bookmarks to be generated and, finally, printed.
  16
+
  17
+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
  18
+
  19
+I've also got the app deployed to heroku at http://printer-bookmarks.heroku.com/
  20
+
  21
+Now I need to make the bookmark a little more printer friendly.
16  templates/bookmark.haml
... ...
@@ -1,11 +1,5 @@
1  
-!!! 5
2  
-
3  
-%html
4  
-  %head
5  
-    %title Bookmark
6  
-  %body
7  
-    %img#cover-image{:src => book.cover_image_url}
8  
-    %h1#book-title= book.title
9  
-    %p Started:
10  
-    %p Finished:
11  
-    %p Notes
  1
+%img#cover-image{:src => book.cover_image_url}
  2
+%h1#book-title= book.title
  3
+%p Started:
  4
+%p Finished:
  5
+%p Notes
9  templates/layout.haml
... ...
@@ -0,0 +1,9 @@
  1
+!!! 5
  2
+
  3
+%html
  4
+  %head
  5
+    %link{:rel => "stylesheet", :href => "http://printer.gofreerange.com/stylesheets/print.css", :type => "text/css", :media => "screen", :charset => "utf-8"}
  6
+  %body.preview
  7
+    .paper
  8
+      .content
  9
+        = yield

0 notes on commit 0ba5366

Please sign in to comment.
Something went wrong with that request. Please try again.