Skip to content

Instantly share code, notes, and snippets.

@benjaminoakes
Created August 24, 2019 02:41
Show Gist options
  • Save benjaminoakes/1d3df3e09678f53bb379d7369956f244 to your computer and use it in GitHub Desktop.
Save benjaminoakes/1d3df3e09678f53bb379d7369956f244 to your computer and use it in GitHub Desktop.
Google Tasks to text
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