<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Laughing Meme &#187; http</title>
	<atom:link href="http://laughingmeme.org/tag/http/feed/" rel="self" type="application/rss+xml" />
	<link>http://laughingmeme.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 29 Jan 2012 21:54:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WOE &#8220;GeoPlanet&#8221;: HTTP/1.1 406 Not Acceptable</title>
		<link>http://laughingmeme.org/2008/11/19/woe-geoplanet-http11-406-not-acceptable/</link>
		<comments>http://laughingmeme.org/2008/11/19/woe-geoplanet-http11-406-not-acceptable/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 23:36:25 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[406]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[geoplanet]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[restful]]></category>
		<category><![CDATA[webservice]]></category>
		<category><![CDATA[woe]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://laughingmeme.org/?p=4087</guid>
		<description><![CDATA[Just putting a note here for the next time I&#8217;m working with the Yahoo! GeoPlanet APIs. The conudrum: a HTTP GET on a given resource (http://where.yahooapis.com/v1/place/23511846?appid=$appid) works in the browser, and works with wget from the command line, but fails from within PHP with a 406 Not Acceptable. The solution, append format=XML to the resource [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/kellan/3039449386/" title="not simple polygons by kellan, on Flickr"><img src="http://farm4.static.flickr.com/3231/3039449386_ccdfe55571.jpg" width="500" height="263" alt="not simple polygons" /></a></p>

<p>Just putting a note here for the next time I&#8217;m working with the <a href="http://developer.yahoo.com/geo/">Yahoo! GeoPlanet</a> APIs.  </p>

<p>The conudrum: a HTTP GET on a given resource (<code>http://where.yahooapis.com/v1/place/23511846?appid=$appid</code>) works in the browser, and works with <code>wget</code> from the command line, but fails from within PHP with a <code>406 Not Acceptable</code>.</p>

<p>The solution, append <code>format=XML</code> to the resource URL, because the service is blowing out its brains on a missing <code>Accept</code>s header.</p>

<p>And that folks is the magic of REST.</p>

<p><strong>update 2008/12/04:</strong> quick scan of my referer logs suggests this is biting folks using <a href="http://search.cpan.org/~gaas/libwww-perl-5.821/lib/LWP/Simple.pm">lwp-simple</a> and wget particularly hard.</p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2008/11/19/woe-geoplanet-http11-406-not-acceptable/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bill de hÓra:  Non-Newtonian readings</title>
		<link>http://laughingmeme.org/2008/08/08/bill-de-hora-non-newtonian-readings/</link>
		<comments>http://laughingmeme.org/2008/08/08/bill-de-hora-non-newtonian-readings/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 15:00:52 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[arrest]]></category>
		<category><![CDATA[beyond rest]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[data streams]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[messaging]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[xmpp]]></category>

		<guid isPermaLink="false">http://laughingmeme.org/?p=3951</guid>
		<description><![CDATA[&#8220;If you enjoyed Kellan Elliott-McCrea and Evan Henshaw-Plath&#8217;s presentation &#8220;Beyond REST? Building data services with XMPP&#8221;, here&#8217;s a dose of links.&#8221; Excellent list.]]></description>
			<content:encoded><![CDATA[<p><em>&#8220;If you enjoyed Kellan Elliott-McCrea and Evan Henshaw-Plath&#8217;s presentation &#8220;Beyond REST? Building data services with XMPP&#8221;, here&#8217;s a dose of links.&#8221;</em>  Excellent list.</p>
<p><a href='http://www.dehora.net/journal/2008/08/08/non-newtonian-reading/'>http://www.dehora.net/journal/2008/08/08/non-newtonian-reading/</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2008/08/08/bill-de-hora-non-newtonian-readings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tim on Etags: &#8220;What you want to do is compute the ETag based on the underlying data resources that actually drive the page creation; the input to that process, not its output.&#8221;</title>
		<link>http://laughingmeme.org/2007/08/01/tim-on-etags-what-you-want-to-do-is-compute-the-etag-based-on-the-underlying-data-resources-that-actually-drive-the-page-creation-the-input-to-that-process-not-its-output/</link>
		<comments>http://laughingmeme.org/2007/08/01/tim-on-etags-what-you-want-to-do-is-compute-the-etag-based-on-the-underlying-data-resources-that-actually-drive-the-page-creation-the-input-to-that-process-not-its-output/#comments</comments>
		<pubDate>Wed, 01 Aug 2007 15:41:12 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[etags]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[ws]]></category>

		<guid isPermaLink="false">http://laughingmeme.org/2007/08/01/tim-on-etags-what-you-want-to-do-is-compute-the-etag-based-on-the-underlying-data-resources-that-actually-drive-the-page-creation-the-input-to-that-process-not-its-output/</guid>
		<description><![CDATA[Was explaing this to folks yesterday who were worrying over bandwidth consumption of their API. Etags can help with that, but if you aren&#8217;t computation/database bound consider that perhaps you haven&#8217;t built a successful enough service.]]></description>
			<content:encoded><![CDATA[<p>Was explaing this to folks yesterday who were worrying over bandwidth consumption of their API.  Etags can help with that, but if you aren&#8217;t computation/database bound consider that perhaps you haven&#8217;t built a successful enough service.</p>
<p><a href='http://www.tbray.org/ongoing/When/200x/2007/07/31/Design-for-the-Web'>http://www.tbray.org/ongoing/When/200x/2007/07/31/Design-for-the-Web</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2007/08/01/tim-on-etags-what-you-want-to-do-is-compute-the-etag-based-on-the-underlying-data-resources-that-actually-drive-the-page-creation-the-input-to-that-process-not-its-output/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>mnot: Bringing Back the Link &#8211; With a Twist</title>
		<link>http://laughingmeme.org/2006/06/25/mnot-bringing-back-the-link-with-a-twist/</link>
		<comments>http://laughingmeme.org/2006/06/25/mnot-bringing-back-the-link-with-a-twist/#comments</comments>
		<pubDate>Sun, 25 Jun 2006 23:40:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[semweb]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=3386</guid>
		<description><![CDATA[I&#8217;ve read through this twice, still sorting out the implications, but it sure sounds exciting.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve read through this twice, still sorting out the implications, but it sure sounds exciting.</p>
<p><a href='http://www.mnot.net/blog/2006/06/22/link'>http://www.mnot.net/blog/2006/06/22/link</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2006/06/25/mnot-bringing-back-the-link-with-a-twist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;&#8230;next week and the week after, when it&#8217;s history, all those aggregators will still be checking it, even though it will never again be updated.&#8221;</title>
		<link>http://laughingmeme.org/2006/01/17/next-week-and-the-week-after-when-its-history-all-those-aggregators-will-still-be-checking-it-even-though-it-will-never-again-be-updated/</link>
		<comments>http://laughingmeme.org/2006/01/17/next-week-and-the-week-after-when-its-history-all-those-aggregators-will-still-be-checking-it-even-though-it-will-never-again-be-updated/#comments</comments>
		<pubDate>Tue, 17 Jan 2006 17:55:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[syndication]]></category>
		<category><![CDATA[winer]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=3192</guid>
		<description><![CDATA[thats what 410 (Gone) is for.]]></description>
			<content:encoded><![CDATA[<p>thats what <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11">410 (Gone)</a> is for.</p>
<p><a href='http://www.scripting.com/2006/01/16.html#When:9:17:07AM'>http://www.scripting.com/2006/01/16.html#When:9:17:07AM</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2006/01/17/next-week-and-the-week-after-when-its-history-all-those-aggregators-will-still-be-checking-it-even-though-it-will-never-again-be-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby, HTTP, and open-uri</title>
		<link>http://laughingmeme.org/2005/04/12/ruby-http-and-open-uri/</link>
		<comments>http://laughingmeme.org/2005/04/12/ruby-http-and-open-uri/#comments</comments>
		<pubDate>Tue, 12 Apr 2005 15:01:33 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=1069</guid>
		<description><![CDATA[Ruby&#8217;s obvious HTTP client library is Net::HTTP (&#8216;net/http&#8217;), however it feels a little bit awkward to use and lacks nice features like following redirects. If you&#8217;re coming from LWP you&#8217;ll be disappointed. However there is a nice wrapper, open-uri that makes it simple to add custom headers, provides loop aware redirect following, etc. And it [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby&#8217;s obvious HTTP client library is <a href="http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html">Net::HTTP</a> (&#8216;net/http&#8217;), however it feels a little bit awkward to use and lacks nice features like following redirects.  If you&#8217;re coming from LWP you&#8217;ll be disappointed. </p>

<p>However there is a nice wrapper, <a href="http://www.ruby-doc.org/stdlib/libdoc/open-uri/rdoc/index.html">open-uri</a> that makes it simple to add custom headers, provides loop aware redirect following, etc.  And it provides a super slick drop in replacement for the <a href="http://www.ruby-doc.org/core/classes/Kernel.html#M001754"><code>Kernel#open</code></a> method, so that you can open either a local file, or a remote URL&#8230;.</p>

<h3>Danger Will Robinson! Danger</h3>

<p>At this point, alarm bells are going off in the heads&#8217; of the PHP programmers in the audience, who are thinking to themselves, </p>

<blockquote>
  <p>&#8220;Wow, someone went to the trouble of making Ruby act PHP-like!  Down to replicating one of the most commonly exploited security holes!&#8221;  </p>
</blockquote>

<p>Sincerest forms of flattery aside, that seems like a really bad idea.  Admittedly you have to explicitly <code>require 'open-uri'</code> in order to activate the feature, howev er as the best of the Ruby HTTP clients (I&#8217;ve found to date) that seems like a decent bet in many web apps, and once you&#8217;ve done that all future calls to <code>open</code> can be hijacked to download remote files.</p>

<p>Now, this being Ruby, there is probably some clever solution involving de-aliasing the <code>open</code> method which makes all these problems go away.  Still this seems like an opportunity for the PHP community, with its near infinite experience with having web apps exploited, to teach the Ruby community something.  Overloading your core file open semantic to transparently open remote resources is a bad idea, full stop.</p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2005/04/12/ruby-http-and-open-uri/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>speed up firefox</title>
		<link>http://laughingmeme.org/2004/12/28/speed-up-firefox/</link>
		<comments>http://laughingmeme.org/2004/12/28/speed-up-firefox/#comments</comments>
		<pubDate>Tue, 28 Dec 2004 19:13:20 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=1168</guid>
		<description><![CDATA[how to tweak firefoxes hidden pipelining prefs. seems to be working great!]]></description>
			<content:encoded><![CDATA[<p>how to tweak firefoxes hidden pipelining prefs.  seems to be working great!</p>
<p><a href='http://www.hackaday.com/entry/1234000803024910/'>http://www.hackaday.com/entry/1234000803024910/</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2004/12/28/speed-up-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementations of RFC3229 with &#8220;feed&#8221;</title>
		<link>http://laughingmeme.org/2004/12/22/implementations-of-rfc3229-with-feed/</link>
		<comments>http://laughingmeme.org/2004/12/22/implementations-of-rfc3229-with-feed/#comments</comments>
		<pubDate>Wed, 22 Dec 2004 20:02:05 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=2724</guid>
		<description><![CDATA[Client and server support for the feed instance manipulation]]></description>
			<content:encoded><![CDATA[<p>Client and server support for the feed instance manipulation</p>
<p><a href='http://bobwyman.pubsub.com/main/2004/09/implementations.html'>http://bobwyman.pubsub.com/main/2004/09/implementations.html</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2004/12/22/implementations-of-rfc3229-with-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FoF 0.1.9 is out</title>
		<link>http://laughingmeme.org/2004/12/21/fof-019-is-out/</link>
		<comments>http://laughingmeme.org/2004/12/21/fof-019-is-out/#comments</comments>
		<pubDate>Tue, 21 Dec 2004 20:11:54 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[aggregator]]></category>
		<category><![CDATA[fof]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[magpie]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=2721</guid>
		<description><![CDATA[Now faster, and with HTTP digest auth support.]]></description>
			<content:encoded><![CDATA[<p>Now faster, and with HTTP digest auth support.</p>
<p><a href='http://minutillo.com/steve/weblog/2004/12/17/fof-0-1-9-is-debugged'>http://minutillo.com/steve/weblog/2004/12/17/fof-0-1-9-is-debugged</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2004/12/21/fof-019-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RSS Bandwidth Strategies</title>
		<link>http://laughingmeme.org/2004/12/21/rss-bandwidth-strategies/</link>
		<comments>http://laughingmeme.org/2004/12/21/rss-bandwidth-strategies/#comments</comments>
		<pubDate>Tue, 21 Dec 2004 16:45:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[timbl]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=985</guid>
		<description><![CDATA[Much concern, hand wringing and advice on RSS bandwidth issues lately. (see Regular Sucking Schedule, and HowTo RSS Feed State). Here&#8217;s some more. skipHours (and co.), ttl, and mod_syndication are all considered harmful. They&#8217;re all under specified, highly ambiguous, poorly supported, poorly implemented, and move logic into the file which should be (and is) in [...]]]></description>
			<content:encoded><![CDATA[<p>
Much concern, hand wringing and advice on RSS bandwidth issues lately.  (see <a href="http://regsched.bookinfo.info/">Regular Sucking Schedule</a>, and <a href="http://www.kbcafe.com/rss/rssfeedstate.html">HowTo RSS Feed State</a>).  Here&#8217;s some more.
</p>

<p><p>
<a href="http://backend.userland.com/skipHoursDays">skipHours (and co.)</a>, <a href="http://blogs.law.harvard.edu/tech/rss#requiredChannelElements">ttl</a>, and <a href="http://web.resource.org/rss/1.0/modules/syndication/">mod_syndication</a> are all considered harmful.  They&#8217;re all under specified, highly ambiguous, poorly supported, poorly implemented, and move logic into the file which should be (and is) in the protocol.   Rule of thumb, if your bandwidth saving mechanism is in your feed, it&#8217;s a mistake.  They promise false hopes of salvation, ignore them.
</p>
<p>
<h3>HTTP <em>Will</em> Save You</h3>
Rather look to:
<ul>
<li>Conditional GET, learn it, live it, love it.  <a href="http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers">Trivial to support</a>, you have my permission to ban clients which don&#8217;t support it.</li></p>

<p><li>GZIP encoding, the obvious solution to bandwidth concerns is to swap a little CPU (and the magic of HTTP caching really does minimize it), for a whole lot of bandwidth savings.  Been looking for a reason to upgrade to <a href="http://httpd.apache.org/docs-2.0/">Apache 2.0</a>?  How about <a href="http://httpd.apache.org/docs-2.0/mod/mod_deflate.html">mod<em>deflate</a> is included by default and is more stable then the arcane (and nomadic) <a href="http://sourceforge.net/projects/mod-gzip/">mod</em>gzip</a> (which was a beacon a in the darkness in its day)</li></p>

<p><li><a href="http://www.faqs.org/rfcs/rfc3229.html">RFC 3229</a> aka HTTP deltas, and <a href="http://asdf.blogs.com/asdf/2004/09/mod_speedyfeed_.html">mod<em>speedyfeed</a> (reason #2 for upgrading Apache 2.0).  Wave of the future, next puncture in the equilibrium, Sam has some notes: <a href="http://intertwingly.net/blog/2004/09/11/Vary-ETag/">Varg ETag</a>, <a href="http://www.intertwingly.net/blog/2004/09/15/Syndication-with-RFC3229">Syndication with RFC3229</a>, <a href="http://www.intertwingly.net/blog/2004/09/18/RFC3229-enabled">RFC3229 enabled</a>, <a href="http://www.intertwingly.net/blog/2004/09/17/mod-speedyfeed">mod</em>speedyfeed</a>.</li>
</ul>
</p>
<p>
<h3>It&#8217;s All About Apache2 and HTTP/1.1</h3>
This post also does double duty as the my weighing in on <a href="http://drbacchus.com/wordpress/index.php?p=844">Apache2 vs PHP</a> <a href="http://shiflett.org/archive/86">mini-</a> <a href="http://blog.coggeshall.org/archives/174_Apache_2.0,_My_Two_Cents.html">controversy</a>
</p>
<p>
<h3>Fat Media</h3>
Obviously none of this will save you from the bandwidth concern of podcasting (or videoblogging!).  I&#8217;m willing concede that those concerns are beyond the scope of basic HTTP, and point your attention to <a href="http://bittorrent.com/">BitTorrent</a>.
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2004/12/21/rss-bandwidth-strategies/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Contact! HTTP Digest Auth works! (in PHP)</title>
		<link>http://laughingmeme.org/2004/12/10/contact-http-digest-auth-works-in-php/</link>
		<comments>http://laughingmeme.org/2004/12/10/contact-http-digest-auth-works-in-php/#comments</comments>
		<pubDate>Fri, 10 Dec 2004 10:14:05 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[magpie]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[snoopy]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=2705</guid>
		<description><![CDATA[Nice work.]]></description>
			<content:encoded><![CDATA[<p>Nice work.</p>
<p><a href='http://minutillo.com/steve/weblog/2004/12/10/contact-http-digest-auth-works'>http://minutillo.com/steve/weblog/2004/12/10/contact-http-digest-auth-works</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2004/12/10/contact-http-digest-auth-works-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mod speedyfeed</title>
		<link>http://laughingmeme.org/2004/09/17/mod-speedyfeed/</link>
		<comments>http://laughingmeme.org/2004/09/17/mod-speedyfeed/#comments</comments>
		<pubDate>Fri, 17 Sep 2004 20:28:44 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[magpie]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=2536</guid>
		<description><![CDATA[Interesting, tracking this for inclusion in Magpie.]]></description>
			<content:encoded><![CDATA[<p>Interesting, tracking this for inclusion in Magpie.</p>
<p><a href='http://www.intertwingly.net/blog/2004/09/17/mod-speedyfeed'>http://www.intertwingly.net/blog/2004/09/17/mod-speedyfeed</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2004/09/17/mod-speedyfeed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>if now() &#8211; ifModifiedSince &lt; 15 minutes then return 304</title>
		<link>http://laughingmeme.org/2004/09/10/if-now-ifmodifiedsince-15-minutes-then-return-304/</link>
		<comments>http://laughingmeme.org/2004/09/10/if-now-ifmodifiedsince-15-minutes-then-return-304/#comments</comments>
		<pubDate>Fri, 10 Sep 2004 19:56:58 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[scalability]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=2524</guid>
		<description><![CDATA[RSS has some serious scalability issues, but we haven&#8217;t hit them yet, current problems are purely implementation hiccups.]]></description>
			<content:encoded><![CDATA[<p>RSS has some serious scalability issues, but we haven&#8217;t hit them yet, current problems are purely implementation hiccups.</p>
<p><a href='http://nick.typepad.com/blog/2004/09/rss_bandwidth_c.html'>http://nick.typepad.com/blog/2004/09/rss_bandwidth_c.html</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2004/09/10/if-now-ifmodifiedsince-15-minutes-then-return-304/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTTP auth as single sign-on web service.</title>
		<link>http://laughingmeme.org/2004/07/14/http-auth-as-single-sign-on-web-service/</link>
		<comments>http://laughingmeme.org/2004/07/14/http-auth-as-single-sign-on-web-service/#comments</comments>
		<pubDate>Thu, 15 Jul 2004 04:44:35 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=2390</guid>
		<description><![CDATA[In Python]]></description>
			<content:encoded><![CDATA[<p>In Python</p>
<p><a href='http://simon.incutio.com/archive/2004/07/15/instant'>http://simon.incutio.com/archive/2004/07/15/instant</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2004/07/14/http-auth-as-single-sign-on-web-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Like Rsync for HTTP</title>
		<link>http://laughingmeme.org/2003/12/08/like-rsync-for-http/</link>
		<comments>http://laughingmeme.org/2003/12/08/like-rsync-for-http/#comments</comments>
		<pubDate>Mon, 08 Dec 2003 23:03:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=678</guid>
		<description><![CDATA[RFC 3229 (HTTP deltas via steve) needs a &#8220;for Hackers&#8221; article in the style of the classic Conditional GET for RSS hackers]]></description>
			<content:encoded><![CDATA[<p><a href="http://rfc3229.x42.com/">RFC 3229</a> (HTTP deltas via <a href="http://saladwithsteve.com/2003_12_01_archive_index.html#107092201557053068">steve</a>) needs a &#8220;for Hackers&#8221; article in the style of the classic <a href="http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers">Conditional GET for RSS hackers</a></p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2003/12/08/like-rsync-for-http/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aggregators and Prior Art</title>
		<link>http://laughingmeme.org/2003/07/22/aggregators-and-prior-art/</link>
		<comments>http://laughingmeme.org/2003/07/22/aggregators-and-prior-art/#comments</comments>
		<pubDate>Tue, 22 Jul 2003 09:01:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[aggregation]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=525</guid>
		<description><![CDATA[Mark reminds us aggregator are HTTP clients, and there&#8217;s a lot of prior art on how HTTP clients are supposed to work. I struggle with how much of this Magpie should be aware of. Its not really an aggregator, but people use it as such. The response code (and in CVS the full headers) are [...]]]></description>
			<content:encoded><![CDATA[<p>
Mark reminds us <a href="http://diveintomark.org/archives/2003/07/21/atom_aggregator_behavior_transport_level.html">aggregator are HTTP clients, and there&#8217;s a lot of prior art on how HTTP clients are supposed to work</a>.
</p>

<p><p>
I struggle with how much of this <a href="http://magpierss.sf.net">Magpie</a> should be aware of.  Its not really an aggregator, but people use it as such.  The response code (and in CVS the full headers) are made available to clients, but for the people using it as a simple drop in to their website, Magpie moves from being a library to the client.
</p>
<p>
A difficult balance, too complicated for my exhausted brain.
</p> 
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2003/07/22/aggregators-and-prior-art/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conditional GET with LWP &amp; Perl</title>
		<link>http://laughingmeme.org/2003/03/01/conditional-get-with-lwp-perl/</link>
		<comments>http://laughingmeme.org/2003/03/01/conditional-get-with-lwp-perl/#comments</comments>
		<pubDate>Sun, 02 Mar 2003 03:16:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=346</guid>
		<description><![CDATA[I was arguing recently that implementing a conditional GET with LWP is trivial and there was no reason why someone wouldn&#8217;t support it. I assumed there must be a dozen examples of how to do this. Afterall O&#8217;reilly has &#8220;open sourced&#8221; their original LWP book, there is an LWP cookbook, and reams of POD. No [...]]]></description>
			<content:encoded><![CDATA[<p>
I was arguing recently that implementing a 
<a href="http://fishbowl.pastiche.org/archives/001132.html">conditional GET</a> with
<a href="http://search.cpan.org/dist/libwww-perl/">LWP</a> is trivial and 
there was no reason why someone wouldn&#8217;t support it.  I assumed there must 
be a dozen examples of how to do this.  Afterall
O&#8217;reilly has &#8220;open sourced&#8221; their 
<a href="http://www.oreilly.com/openbook/webclient/">original LWP book</a>, 
there is an 
<a href="http://www.perldoc.com/perl5.6/lib/lwpcook.html">LWP cookbook</a>, and
reams of 
<a href="http://search.cpan.org/dist/libwww-perl/lib/LWP.pm">POD</a>.  
</p>

<p><p>
<h3>No Such Luck</h3>
Well a quick search didn&#8217;t turn up anything.  A more concerted one might have
but it was easier to write this example then keep searching.  If you&#8217;re looking
for more general info on Conditional GETs try Charles Miller&#8217;s 
<a href="http://fishbowl.pastiche.org/archives/001132.html">HTTP Conditional Get for RSS Hackers</a>.  If you&#8217;re looking for an implementation
in PHP, you might look in rss_fetch of my RSS parser/aggregator 
<a href="http://magpierss.sf.net">Magpie</a>.
<p>
<h3>Conditional GET</h3>
The basic idea is,  when you request a file you remember the <code>ETag</code> and 
<code>Last-Modified</code> HTTP headers, passing
them along with your next request as 
<code>If-None-Match</code> and <code>If-Last-Modified</code>.  If the
file has changed then you&#8217;ll get the content as normal, if the file hasn&#8217;t changed you&#8217;ll get
a &#8217;304 Not Modified&#8217; header.
</p>
<p>
This is something of a toy example, but I try to be as correct as possible with
it.  Noteable in its absence is doing anything with the file you&#8217;ve fetched.
(for example parsing and storing an RSS feed)  Also I use a simple file to store
ETag and Last-Modified, you might want to use a different backend.<br />
<a href="http://laughingmeme.org/archives/000479.html#more">See the Code</a>
</p></p>

<p>
<h3>Example Code</h3>
<pre class="code">

use LWP::UserAgent;
use HTTP::Request;

my $url = "http://localhost/rss/laughingmeme.rdf";
my $cache_file = 'cache';
my %headers;

if ( -e $cache_file ) {
    open (CACHE, "&lt; $cache_file") or die "Couldn't open: $!";
    %headers = (
        If_None_Match =&gt; &lt;CACHE&gt;,
        If_Last_Modified =&gt; &lt;CACHE&gt;
    );
    close CACHE;
}

my $ua = new LWP::UserAgent();
$ua-&gt;agent("Conditionally Enabled v0.1");

my $req = HTTP::Request-&gt;new( GET =&gt; $url );
$req-&gt;header(%headers);

my $res = $ua-&gt;request($req);
if ($res-&gt;is_success) {
    print "new!\n";
    # save ETag &#038; Last-Modified
    open (CACHE, "&gt; $cache_file") or die "Couldn't open: $!";
    print CACHE $res-&gt;header('ETag'), "\n";
    print CACHE $res-&gt;header('Last-Modified'), "\n";
    close CACHE;
}
elsif ( $res-&gt;code() eq '304' ) {
    print "not modified, go to cache\n";
    # do logic for RSS not modified
}
else {
    print "fooey! somthing went wrong\n";
}
</pre>
</p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2003/03/01/conditional-get-with-lwp-perl/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>There Has Got To Be A Better Way</title>
		<link>http://laughingmeme.org/2002/10/23/there-has-got-to-be-a-better-way/</link>
		<comments>http://laughingmeme.org/2002/10/23/there-has-got-to-be-a-better-way/#comments</comments>
		<pubDate>Thu, 24 Oct 2002 02:54:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[magpie]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=191</guid>
		<description><![CDATA[So I&#8217;ve got this nifty little RSS parser doohickey, Magpie. In the name of lowering the curve, and weaning PHP programmers away from their previously available hackish solutions I tried to make it as simple to use, and &#8220;PHP-like&#8221; as possible. Meaning that fetching the remote feed, and parsing it, and caching it have been [...]]]></description>
			<content:encoded><![CDATA[<p>
So I&#8217;ve got this nifty little RSS parser doohickey, <a href="http://magpierss.sf.net">Magpie</a>.  In the name of lowering the curve, and weaning PHP programmers away from their previously available hackish solutions I tried to make it as simple to use, and &#8220;PHP-like&#8221; as possible.  Meaning that fetching the remote feed, and parsing it, and caching it have been rolled into one convenient step.  Now that 
<a href="http://fishbowl.pastiche.org/archives/001132.html">HTTP conditional GETs</a> are all the rage, I&#8217;m adding them to Magpie. (I&#8217;ve had an ugly implementation lying around for a while, but its not even worth check into CVS)
</p>

<p><p>
<h3>PHP as Web Client</h3>
But how the hell does one do web automation with PHP?  I feel like no one has ever taken this problem on before in PHP.  Or at least no one on the web is talking 
about it somewhere I can find it.  How does one get at <code>If-Modified-Since</code>, <code>Last-Modified</code>, and <code>Etag</code>?   Where is <a href="http://www.linpro.no/lwp/">LWP</a> or <a href="http://www.python.org/doc/2.2.1/lib/module-urllib2.html">urllib2</a> for PHP?<br />
</p>
<p>
You can get at the <b>response</b> headers from <code>fopen()</code> from the array <code>$http<em>response</em>header</code> which is magically instaniated behind the scenes. (because PHP does that kind of thing)  I wonder if I stuffed some vaules into an array named <code>$http<em>request</em>header</code>, would it work? (<b>No</b>, it doesn&#8217;t)</p>

<h4>PHP Cookbook</h4>

<p>The <a href="http://www.oreilly.com/catalog/phpckbk/">PHP Cookbook</a> has a tantalizing Chapter 11 entitled &#8220;Web Automation&#8221;, with rule 11.1 being &#8220;Fetching URLs with GET&#8221;, and rule 11.4 &#8220;Fetching URLs with Headers&#8221;, sounding just about perfect.   And its supposed to come out this November, could only by 9 days, but I&#8217;m impatient.   I&#8217;m going to stop by <a href="http://www.quantumbooks.com/">Quantum</a> today, to see if they have one of their looks-like-someone-snuck-it-out-the-back-door-and-photo-copied-it O&#8217;Reilly specials.</p>

<h4>Rolling Your Own</h4>

<p>So barring the deliverance from on high by O&#8217;Reilly it appears that the only way I&#8217;m going to get these features right now is to roll my own using <code>fsockopen()</code> and hand-packed headers.  Have I mentioned that PHP is sadly deficient in tools?
</p>
<p>
<b>update, 10/25</b>:  So the word on the street is &#8220;just use sockets&#8221;, the answer rolls off the mailing lists and newsgroups, with the polish and weariness of a frequently asked question.  No one suggested it, but I&#8217;m also intrigued by <a href="http://snoopy.sf.net">Snoopy, the web client class for PHP</a>.  I think I&#8217;ll start by rolling my own, and loop back to Snoopy when I have time to do benchmarks.<br />
</p>
<p>
<b>fyi:</b> ended up using Snoopy, very happy with it.
</p>
<p>
<h3>The Impenetrable Importance of Culture</h3>
For me the hardest part in working with languages I&#8217;m less familiar with (Python, and PHP for example) rather then those I&#8217;m more comfortable with (Perl or Java) is not syntax questions, it&#8217;s culture.  For all of Perl&#8217;s much vaunted &#8220;There is More Then One Way To Do It&#8221;, I know the proper way to do things, the proper tool to reach for, and if I don&#8217;t I have ways of finding out, largely through internal calculation based on my understanding of the Perl reputation landscape.  It is that information which is opaque to me, especially in PHP where the vast number of practioners are novices.
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2002/10/23/there-has-got-to-be-a-better-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

