{"id":71,"date":"2007-03-16T15:28:54","date_gmt":"2007-03-16T23:28:54","guid":{"rendered":"http:\/\/jaredrobinson.com\/blog\/?p=71"},"modified":"2007-03-16T15:28:54","modified_gmt":"2007-03-16T23:28:54","slug":"mtnwestruby-black-boxing-with-ruby","status":"publish","type":"post","link":"https:\/\/jaredrobinson.com\/blog\/mtnwestruby-black-boxing-with-ruby\/","title":{"rendered":"mtnwestruby: Black-boxing with Ruby"},"content":{"rendered":"<p>\nMountain West Ruby Conference: SBN<br \/>\nTag: mtnwestruby<br \/>\n16 March 2007\n<\/p>\n<p>\nJames Britt &#8211; Black-boxing with Ruby\n<\/p>\n<p>\nReinventing the wheel is overrated. Why not reuse what other people have already implemented, even from other languages?<\/p>\n<p>\nTrac: A good project tracking system. Requires too much use of the mouse.<br \/>\nWhat if: I could use Trac from the command line?  Tracula.\n<\/p>\n<p>Tracula is written in Ruby and uses Hpricot &#038; Mechanize to pretend to be a web browser.  Unfortunately, tracula is brittle because the web page UI tends to change &#8212; it&#8217;s not an API they&#8217;re publishing. Many features are missing from Tracula, but that&#8217;s ok &#8212; he writes the functionality as he needs it, and stubs out missing behavior with hardcoded values.\n<\/p>\n<p>\nTracula acts as a proxy, so the code using tracula doesn&#8217;t break just because trac changes.\n<\/p>\n<\/p>\n<p>\nWordPress: A best of breed web log system.<br \/>\nWhat if: I could have the great comment system for the Django Book?<br \/>\nwww.djangobook.com. Uses Yahoo UI and Yahoo.EXT.<br \/>\nComet is written in Ruby. Comments made by users are redirected via Apache modprox through comet, which takes the comment, and posts it to WordPress.<\/p>\n<p>\nLessons learned:<\/p>\n<ul>\n<li>WordPress plugins are the way to go.\n<li>Repurposing other people&#8217;s code can bite your hard.\n<li>Most web sites offer APIs, including TRAC. Use them, but still use a proxy layer so your software is insulated from changes in the API.\n<li>Proxies can add exception handling that is missing from APIs.\n<\/ul>\n<\/p>\n<p>\nTechniques:<\/p>\n<ul>\n<li>Screen scraping\n<li>DOM munging\n<li>Proxies, proxies, proxies!\n<li>Save off a copy of web pages while you are developing your HTML screen scraper, and hit those saved pages so that you don&#8217;t run up someone&#8217;s bandwidth bill.\n<\/ul><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mountain West Ruby Conference: SBN Tag: mtnwestruby 16 March 2007 James Britt &#8211; Black-boxing with Ruby Reinventing the wheel is overrated. Why not reuse what other people have already implemented, even from other languages? Trac: A good project tracking system. Requires too much use of the mouse. What if: I could use Trac from the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jaredrobinson.com\/blog\/mtnwestruby-black-boxing-with-ruby\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;mtnwestruby: Black-boxing with Ruby&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,17],"tags":[],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-programming","category-tech"],"_links":{"self":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":0,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}