Skip to content

Instantly share code, notes, and snippets.

@nbqx
Created April 22, 2011 10:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nbqx/936403 to your computer and use it in GitHub Desktop.
Save nbqx/936403 to your computer and use it in GitHub Desktop.
##earthquake.ge plugin
##post url to instapaper.com
Earthquake.init do
_ = config[:instapaper] ||= {}
_[:user] ||= ''
_[:password] ||= ''
command :instapaper do |m|
tweet = twitter.status(m[1])["text"]
tweet.scan(/http[s]?\:\/\/[\w\+\$\;\?\.\%\,\!\#\~\*\/\:\@\&\\\=\_\-]+/) do |u|
Net::HTTP.start("www.instapaper.com",80) do |r|
r.get("/api/add?username=#{_[:user]}&password=#{_[:password]}&url=#{u}&auto-title=1")
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment