Skip to content

Instantly share code, notes, and snippets.

@StarWhite
Forked from jugyo/instapaper.rb
Created March 16, 2012 15:34
Show Gist options
  • Save StarWhite/2050565 to your computer and use it in GitHub Desktop.
Save StarWhite/2050565 to your computer and use it in GitHub Desktop.
Earthquake.gem plugin(post url to Read It Later)
# earthquake.gem plugin
# post url to Read It Later
require 'open-uri'
Earthquake.init do
_ = config[:ril] ||= {}
_[:user] ||= 'username'
_[:password] ||= 'your_password'
_[:apikey] ||= 'your_apikey'
# Sign Up for the Read It Later API
# http://readitlaterlist.com/api/signup/
command :ril do |m|
tweet =twitter.status(m[1])["text"]
tweet.scan(/http[s]?\:\/\/[\w+\$\;\?\.\%\,\!\#\~\*\/\:\@\&\\\=\_\-]+/) do |u|
if confirm "add to Read It Later '#{u}'"
async do
open ("https://readitlaterlist.com/v2/add?username=#{_[:user]}&password=#{_[:password]}&apikey=#{_[:apikey]}&url=#{u}")
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment