-
-
Save jugyo/940258 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# earthquake.ge plugin | |
# post url to instapaper.com | |
# | |
# Fork of https://gist.github.com/936403 | |
require 'open-uri' | |
Earthquake.init do | |
_ = config[:instapaper] ||= {} | |
_[:user] ||= '' | |
_[:password] ||= '' | |
command :instapaper do |m| | |
tweet = twitter.status(m[1])["text"] | |
tweet.scan(/http[s]?\:\/\/[\w\+\$\;\?\.\%\,\!\#\~\*\/\:\@\&\\\=\_\-]+/) do |u| | |
if confirm "add to instapaper '#{u}'" | |
async do | |
open("https://www.instapaper.com/api/add?username=#{_[:user]}&password=#{_[:password]}&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