<?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>D&#039;Arcy Norman dot net &#187; hacking</title>
	<atom:link href="http://www.darcynorman.net/tag/hacking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.darcynorman.net</link>
	<description>apparently much happier in person</description>
	<lastBuildDate>Fri, 20 Nov 2009 03:52:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>FlickrStickr module ported to use Curl</title>
		<link>http://www.darcynorman.net/2006/05/22/flickrstickr-module-ported-to-use-curl/</link>
		<comments>http://www.darcynorman.net/2006/05/22/flickrstickr-module-ported-to-use-curl/#comments</comments>
		<pubDate>Wed, 31 Dec 1969 17:00:00 +0000</pubDate>
		<dc:creator>dnorman</dc:creator>
				<category><![CDATA[drupal]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[module]]></category>

		<guid isPermaLink="false">1225308498</guid>
		<description><![CDATA[<p> The <a href="http://drupal.org/node/52543">FlickrStickr module</a> for Drupal adds the handy Flock-like Flickr Photo Browser, making it easy peasy to add photos from Flickr to content in Drupal. But, the module uses the PHP <code>fopen()</code> command, which is disabled on Dreamhost&#39;s servers for security reasons. </p> <p> So, with some really quick hackery (more like copy-and-pastery, following <a href="http://www.phpit.net/article/using-curl-php/">this example</a>) I ported the module to use <code>curl</code> instead, and it works great. It doesn&#39;t seem to be able to insert images into the TinyMCE editor, so you have to toggle back to text mode to insert an image (oh, the irony!) </p> <p> Basically, the &#34;port&#34; involved changing this: </p> <pre><code>   $fp= fopen("http://www.flickr.com/services/...reallylongurltruncatedhere...", "r");
   while (!feof($fp)) {
      $buffer= fgets($fp, 4096);
      echo $buffer;
   }</code></pre> <p> to this: </p> <pre><code>   $curler = curl_init();
   $urlToCurl = "http://www.flickr.com/services/...reallylongurltruncatedhere...");
   curl_setopt($curler, CURLOPT_URL, $urlToCurl);
   curl_exec($curler);
   curl_close($curler);</code></pre> <p> There were 2 locations that needed changing. Just search for &#34;fopen&#34; and you&#39;ll find them. Use the same pattern of changes for both, and test before deploying. </p> <p> <img class="flickrsitckr_image" src="http://static.flickr.com/49/150903041_60baf92925_t.jpg" /><img class="flickrsitckr_image" src="http://static.flickr.com/55/150902688_368a11323b_t.jpg" /><img class="flickrsitckr_image" src="http://static.flickr.com/55/150902023_009d2e631c_t.jpg" /><img class="flickrsitckr_image" src="http://static.flickr.com/56/150901636_4b61145eaf_t.jpg" /><img class="flickrsitckr_image" src="http://static.flickr.com/56/150901230_7fa8ce5059_t.jpg" /> </p> ]]></description>
			<content:encoded><![CDATA[<p> The <a href="http://drupal.org/node/52543">FlickrStickr module</a> for Drupal adds the handy Flock-like Flickr Photo Browser, making it easy peasy to add photos from Flickr to content in Drupal. But, the module uses the PHP <code>fopen()</code> command, which is disabled on Dreamhost&#39;s servers for security reasons. </p>
<p> So, with some really quick hackery (more like copy-and-pastery, following <a href="http://www.phpit.net/article/using-curl-php/">this example</a>) I ported the module to use <code>curl</code> instead, and it works great. It doesn&#39;t seem to be able to insert images into the TinyMCE editor, so you have to toggle back to text mode to insert an image (oh, the irony!) </p>
<p> Basically, the &quot;port&quot; involved changing this: </p>
<pre><code>   $fp= fopen("http://www.flickr.com/services/...reallylongurltruncatedhere...", "r");
   while (!feof($fp)) {
      $buffer= fgets($fp, 4096);
      echo $buffer;
   }</code></pre>
<p> to this: </p>
<pre><code>   $curler = curl_init();
   $urlToCurl = "http://www.flickr.com/services/...reallylongurltruncatedhere...");
   curl_setopt($curler, CURLOPT_URL, $urlToCurl);
   curl_exec($curler);
   curl_close($curler);</code></pre>
<p> There were 2 locations that needed changing. Just search for &quot;fopen&quot; and you&#39;ll find them. Use the same pattern of changes for both, and test before deploying. </p>
<p> <img class="flickrsitckr_image" src="http://static.flickr.com/49/150903041_60baf92925_t.jpg" /><img class="flickrsitckr_image" src="http://static.flickr.com/55/150902688_368a11323b_t.jpg" /><img class="flickrsitckr_image" src="http://static.flickr.com/55/150902023_009d2e631c_t.jpg" /><img class="flickrsitckr_image" src="http://static.flickr.com/56/150901636_4b61145eaf_t.jpg" /><img class="flickrsitckr_image" src="http://static.flickr.com/56/150901230_7fa8ce5059_t.jpg" /> </p>
 <img src="http://www.darcynorman.net/wp-content/plugins/feed-statistics.php?view=1&post_id=1203" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.darcynorman.net/2006/05/22/flickrstickr-module-ported-to-use-curl/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
