Created
April 2, 2013 18:48
-
-
Save duongkai/5295033 to your computer and use it in GitHub Desktop.
This script will send a specified book to your Kindle App
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
# version 0.1 | |
# this script will send a particular book to my kindle app | |
require 'gmail' | |
if ARGV.length != 1 | |
puts "Wrong syntax. $SendToMyKindle.rb <path_to_book>" | |
abort "Wrong input" | |
end | |
sending_book = ARGV[0] | |
EMAIL = '[email protected]' | |
PWD = 'neptune' | |
KINDLE_EMAIL = '[email protected]' # The kindle email associcates with my Nexus 7 kindle | |
Gmail.new(EMAIL, PWD) do |mail| | |
mail.deliver do | |
to KINDLE_EMAIL | |
book_title = File.basename sending_book | |
subject "Sending book #{book_title} to my Nexus 7" | |
add_file sending_book | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment