mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Rake to dump list of screenshots for future ML research
This commit is contained in:
parent
225bf84946
commit
a9e49d7cdd
1 changed files with 13 additions and 0 deletions
13
Rakefile
13
Rakefile
|
@ -582,5 +582,18 @@ task :generate_sitemap => [:environment] do
|
|||
gz.write %{</sitemapindex>}
|
||||
end
|
||||
|
||||
desc 'ml_screenshots_list_dump'
|
||||
task :ml_screenshots_list_dump => [:environment] do
|
||||
['phishing', 'spam', 'ham', nil].each do |classifier|
|
||||
File.open("./files/screenshot-urls-#{classifier.to_s}.txt", 'w') do |fp|
|
||||
SiteFile.where(classifier: classifier).where(path: 'index.html').each do |site_file|
|
||||
begin
|
||||
fp.write "#{site_file.site.screenshot_url('index.html', Site::SCREENSHOT_RESOLUTIONS.first)}\n"
|
||||
rescue NoMethodError
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue