by zdw · 13y ago · 0 comments
Safari on OS X puts the source link of a downloaded file in the spotlight metadata, which can be accessed via "mdls" - an excerpt:
$ mdls Inconsolata-Bold.ttf
-- other metadata --
kMDItemWhereFroms = (
"http://googlefontdirectory.googlecode.com/hg/ofl/inconsolata/Inconsolata-Bold.ttf,
"http://code.google.com/p/googlefontdirectory/source/browse/ofl/inconsolata/Inconsolata-Bold.ttf
)
Personally, I'd find that much more useful than the "all pdf's are books" example. Maid.rules do
rule 'Old files downloaded while developing/testing' do
dir('~/Downloads/*').each do |path|
if downloaded_from(path).any? {|u| u.match 'http://localhost'} && 1.week.since?(last_accessed(path))
trash(path)
end
end
end
end