Last active
June 9, 2019 21:37
-
-
Save romanblanco/644682d2f646083a6ac96d10bcbbff07 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby """ | |
def photo_gps_list | |
photos_dir = File.absolute_path('assets/photos/') | |
photos_url = '/assets/photos/' | |
photos = Dir.entries(photos_dir).select { |filename| filename if filename.end_with?('jpg') } | |
result = photos.map do |photo| | |
photo_exif = EXIFR::JPEG.new(photos_dir + '/' + photo) | |
puts "#{photo}, #{photo_exif.exif.date_time_original}, #{photo_exif.gps.longitude}, #{photo_exif.gps.latitude}" unless photo_exif.gps.nil? | |
end | |
end | |
photo_gps_list | |
""" | |
irb> photo_gps_list > b | |
sort -k1 < b > d | |
ipfs ls QmdWeEuqA6gHACFGYd8yfiwyX8QGrQ7GzxRDdQPxf3VZxA > a | |
sort -k3 < a > c | |
cat d |sed 's/\|/ /'| sed 's/,//' |awk '{print $1}' > files_with_gps | |
grep -f files_with_gps c > ipfs_files_with_gps> | |
paste ipfs_files_with_gps d > graffiti_list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment