<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Stupid attachment_fu tricks, part 1</title>
	<atom:link href="http://www.coffeepowered.net/2008/09/25/stupid-attachment_fu-tricks-part-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coffeepowered.net/2008/09/25/stupid-attachment_fu-tricks-part-1/</link>
	<description>code and content</description>
	<lastBuildDate>Thu, 02 Feb 2012 08:43:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Add remote picture with attachment_fu &#8211; Jupiter Technology</title>
		<link>http://www.coffeepowered.net/2008/09/25/stupid-attachment_fu-tricks-part-1/comment-page-1/#comment-608</link>
		<dc:creator>Add remote picture with attachment_fu &#8211; Jupiter Technology</dc:creator>
		<pubDate>Sun, 12 Sep 2010 10:02:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.coffeepowered.net/?p=27#comment-608</guid>
		<description>[...] class Photo &lt; ActiveRecord::Base require &#039;open-uri&#039; belongs_to :user has_attachment :content_type =&gt; :image, :storage =&gt; (Rails.env === &#039;production&#039; ? :s3 : :file_system), :max_size =&gt; 2.megabyte, :processor =&gt; :MiniMagick, :thumbnails =&gt; { :small =&gt; &#039;100x100&gt;&#039;, :medium =&gt; &#039;150x150&gt;&#039;, :large =&gt; &#039;400x400&gt;&#039; }, :path_prefix =&gt; &quot;public/images/#{table_name}&quot; validates_as_attachment def source_uri=(uri) io = open(URI.parse(uri)) (class &lt;&lt; io; self; end;).class_eval do define_method(:original_filename) { base_uri.path.split(&#039;/&#039;).last } end self.uploaded_data = io end end And we need to create a new photo using the facebppk open graph profile picture url: photo = Photo.new(:source_uri =&gt; &quot;http://graph.facebook.com/#{current_user.facebook_uid}/picture&quot;) For an other similar solution can be found at Coffee Powerred Blog click here. [...]</description>
		<content:encoded><![CDATA[<p>[...] class Photo &lt; ActiveRecord::Base require &#039;open-uri&#039; belongs_to :user has_attachment :content_type =&gt; :image, :storage =&gt; (Rails.env === &#039;production&#039; ? :s3 : :file_system), :max_size =&gt; 2.megabyte, :processor =&gt; :MiniMagick, :thumbnails =&gt; { :small =&gt; &#039;100&#215;100&gt;&#039;, :medium =&gt; &#039;150&#215;150&gt;&#039;, :large =&gt; &#039;400&#215;400&gt;&#039; }, :path_prefix =&gt; &quot;public/images/#{table_name}&quot; validates_as_attachment def source_uri=(uri) io = open(URI.parse(uri)) (class &lt;&lt; io; self; end;).class_eval do define_method(:original_filename) { base_uri.path.split(&#039;/&#039;).last } end self.uploaded_data = io end end And we need to create a new photo using the facebppk open graph profile picture url: photo = Photo.new(:source_uri =&gt; &quot;<a href="http://graph.facebook.com/#" rel="nofollow">http://graph.facebook.com/#</a>{current_user.facebook_uid}/picture&quot;) For an other similar solution can be found at Coffee Powerred Blog click here. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor Turk</title>
		<link>http://www.coffeepowered.net/2008/09/25/stupid-attachment_fu-tricks-part-1/comment-page-1/#comment-2</link>
		<dc:creator>Trevor Turk</dc:creator>
		<pubDate>Fri, 26 Sep 2008 10:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.coffeepowered.net/?p=27#comment-2</guid>
		<description>I&#039;m not sure if it&#039;s better or anything, but I&#039;ve been doing this like so: 
  &lt;a href=&quot;http://github.com/trevorturk/el-dorado/tree/master/lib/attachment_fu_extensions.rb&quot; rel=&quot;nofollow&quot;&gt;http://github.com/trevorturk/el-dorado/tree/maste...&lt;/a&gt;  
 
and 
  &lt;a href=&quot;http://github.com/trevorturk/el-dorado/tree/master/app/models/upload.rb&quot; rel=&quot;nofollow&quot;&gt;http://github.com/trevorturk/el-dorado/tree/maste...&lt;/a&gt; </description>
		<content:encoded><![CDATA[<p>I&#039;m not sure if it&#039;s better or anything, but I&#039;ve been doing this like so:</p>
<p>  <a href="http://github.com/trevorturk/el-dorado/tree/master/lib/attachment_fu_extensions.rb" rel="nofollow">http://github.com/trevorturk/el-dorado/tree/maste&#8230;</a>  </p>
<p>and</p>
<p>  <a href="http://github.com/trevorturk/el-dorado/tree/master/app/models/upload.rb" rel="nofollow">http://github.com/trevorturk/el-dorado/tree/maste&#8230;</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

