<?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>Serious Orange &#187; Shell tricks</title>
	<atom:link href="http://seriousorange.com/category/shell-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://seriousorange.com</link>
	<description></description>
	<lastBuildDate>Fri, 08 Jan 2010 02:40:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Converting Safari cookies.plist to cookies.txt</title>
		<link>http://seriousorange.com/2010/01/converting-safari-cookies-plist-to-cookies-txt/</link>
		<comments>http://seriousorange.com/2010/01/converting-safari-cookies-plist-to-cookies-txt/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 02:43:37 +0000</pubDate>
		<dc:creator>Roger</dc:creator>
				<category><![CDATA[Shell tricks]]></category>

		<guid isPermaLink="false">http://seriousorange.com/?p=17</guid>
		<description><![CDATA[wget is great for resuming downloads, something that no browser handles correctly. It has a very handy option, --load-cookie-file, which takes a cookies.txt style file from your browser and correctly serves it to the web server you&#8217;re connecting to. This is useful so you can download files where you have to log in first. But [...]]]></description>
			<content:encoded><![CDATA[<p><tt>wget</tt> is great for resuming downloads, something that no browser handles correctly.  It has a very handy option, <tt>--load-cookie-file</tt>, which takes a cookies.txt style file from your browser and correctly serves it to the web server you&#8217;re connecting to.  This is useful so you can download files where you have to log in first.</p>
<p>But of course, Safari doesn&#8217;t use the cookies.txt file format.  Fortunately, Ruby and the plist gem come to the rescue.</p>
<p><code><br />
$ sudo gem install plist<br />
$ irb<br />
>> require 'plist'<br />
>> result = Plist::parse_xml("Library/Cookies/Cookies.plist")<br />
>> File.open("cookies.txt", "w") {|f| result.each {|r| f.write("#{r["Domain"]}\tTRUE\t#{r["Path"]}\tFALSE\t#{r["Expires"].strftime("%s")}\t#{r["Name"]}\t#{r["Value"]}\n")}}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://seriousorange.com/2010/01/converting-safari-cookies-plist-to-cookies-txt/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

