Created
August 24, 2019 02:41
-
-
Save benjaminoakes/1d3df3e09678f53bb379d7369956f244 to your computer and use it in GitHub Desktop.
Google Tasks to text
This file contains 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
require 'json' | |
json=JSON.parse(File.read('Tasks.json')) | |
puts json['items'].map { |l| "\n\n**" + l['title'] + "**\n\n" + l['items'].reject { |t| t['deleted'] }.reject { |t| t['status'] == 'completed' }.map{|t| t['notes'] ? (t['notes'].match(/^http/) ? "[#{t['title']}](#{t['notes']}) #{t['due']}" : "#{t['title']} (#{t['notes']}) #{t['due']}") : "#{t['title']} #{t['due']}" }.join("\n")} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment