<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -12,21 +12,30 @@ begin
   require 'hpricot'
   
   class GetDoc
+    attr_accessor :transformation
+    
     CACHE_DIR = File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;cache&quot;)
     CACHE_REFRESH = 1 * 60 # 1 minute
     
-    def initialize(docid, url = &quot;http://docs.google.com/View?id=%s&quot;, &amp;block)
+    GOOGLE_URL = &quot;http://docs.google.com/View?id=%s&quot;
+    GOOGLE_TRANSFORM =
+      proc do |hpricot|
+        (hpricot / &quot;#doc-contents&quot;).inner_html.
+          gsub(/(src|href)=&quot;(View\?|File\?)/, &quot;\\1=\&quot;http://docs.google.com/\\2&quot;)
+      end
+    
+    def self.reset_cache
+      FileUtils.rm Dir.glob(File.join(CACHE_DIR, &quot;*&quot;))
+    end
+    
+    def initialize(docid, url = GOOGLE_URL, &amp;block)
       @docid = docid
       @url = url
-      @transformation = block ||
-        proc do |hpricot|
-          (hpricot / &quot;#doc-contents&quot;).inner_html.
-            gsub(/(src|href)=&quot;(View\?|File\?)/, &quot;\\1=\&quot;http://docs.google.com/\\2&quot;)
-        end
+      @transformation = block || GOOGLE_TRANSFORM
     end
     
     def cache_file
-      File.join(CACHE_DIR, @docid)
+      File.join(CACHE_DIR, @docid.gsub(&quot;/&quot;, &quot;-&quot;))
     end
     
     def cache_age</diff>
      <filename>ruby/get_doc.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,8 +2,23 @@
    &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
 &lt;%
 	require File.join(File.dirname(__FILE__), &quot;ruby/get_doc&quot;)
+	# Default document is a Google word processing document
 	google_doc = GetDoc.new(&quot;dcjnq5tv_4gw4qk2&quot;)
-	# blog_post = GetDoc.new()
+
+	# Getting a document from somewhere other than google docs is possible, but it
+	# is a little more complicated, because we need to specify the following:
+	# 1. The URL of the post without the domain
+	# 2. The domain of the blog, and the location in the string to insert the post (%s)
+	# 3. A transformation proc which can extract the content from the blog using hpricot
+	blog_post = GetDoc.new(
+		&quot;2008/07/15/lucky-to-be-a-programmer&quot;,
+		&quot;http://blog.inquirylabs.com/%s&quot;) do |hpricot|
+			(hpricot / &quot;.PostHead h1:first&quot;).to_html +
+			(hpricot / &quot;.PostContent:first&quot;).inner_html
+	end
+
+	# Uncomment the following line to have the cache cleared for EVERY page load
+	# GetDoc.reset_cache
 %&gt;
 &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot;&gt;
 	&lt;head&gt;
@@ -33,7 +48,7 @@
 					&lt;div id=&quot;right&quot;&gt;
 						&lt;div class=&quot;sideitem&quot;&gt;
 							&lt;h1&gt;Blog Post&lt;/h1&gt;
-							&lt;%= &quot;blog_post&quot; %&gt;
+							&lt;%= blog_post %&gt;
 						&lt;/div&gt;
 					&lt;/div&gt;
 				&lt;/div&gt;			</diff>
      <filename>sample.rhtml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e1a796b054ae039f0e9e37f11f741fe17d2bf08c</id>
    </parent>
  </parents>
  <author>
    <name>Duane Johnson</name>
    <email>duane.johnson@gmail.com</email>
  </author>
  <url>http://github.com/canadaduane/getdoc/commit/41a631a589f78426c95f4c008def60b87911b483</url>
  <id>41a631a589f78426c95f4c008def60b87911b483</id>
  <committed-date>2008-07-20T21:25:54-07:00</committed-date>
  <authored-date>2008-07-20T21:25:54-07:00</authored-date>
  <message>Added example of non-google-doc usage</message>
  <tree>daf2021a7bc081a3af6e344948dd0e5b6ffe2e59</tree>
  <committer>
    <name>Duane Johnson</name>
    <email>duane.johnson@gmail.com</email>
  </committer>
</commit>
