Skip to content

Instantly share code, notes, and snippets.

@paralleltree
Created January 19, 2018 10:50
Show Gist options
  • Save paralleltree/7f5cd6a86542c850e761feaf56cce351 to your computer and use it in GitHub Desktop.
Save paralleltree/7f5cd6a86542c850e761feaf56cce351 to your computer and use it in GitHub Desktop.
PushBullet command
#!/usr/bin/env ruby
# requirements: ruby-pushbullet gem
require 'pushbullet'
if ARGV.count == 0
name = __FILE__.tap { |f| break File.basename(f, File.extname(f)) }
warn "#{name} - An client of Pushbullet"
warn "Usage: #{name} [title] [file]"
warn "If no input files are specified, then the standard input is read."
exit 1
end
Pushbullet.api_token = "token"
Pushbullet::Contact.me.tap do |me|
me.push_note(ARGV.shift, ARGF.read)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment