Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
MacRuby script to export Safari 5.1 cookies to a human-readable format
#!/usr/bin/env macruby
require 'csv'
framework 'Foundation'
CSV_Headers = %w[domain path expiresDate name value].to_csv
class NSHTTPCookie
def to_csv
[domain, path, expiresDate, name, value].to_csv
end
end
def cookie_store
NSHTTPCookieStorage.sharedHTTPCookieStorage
end
def cookies_csv
raw_csv = cookie_store.cookies.map(&:to_csv)
raw_csv.unshift(CSV_Headers)
raw_csv.join
end
puts cookies_csv
#!/usr/bin/env macruby
require 'csv'
framework 'Foundation'
store = NSHTTPCookieStorage.sharedHTTPCookieStorage
cookies = store.cookies
raw = cookies.map do |c|
[c.domain, c.path, c.expiresDate, c.name, c.value].to_csv
end
raw.unshift %w[domain path expiresDate name value].to_csv
puts raw.join
@sgonyea
Owner

TMTOWTDI rocks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.