Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Sinatra app for saving links to Backpack

View backpack_it.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
require 'rubygems'
require 'sinatra'
require 'rest_client'
require 'pismo'
 
set :api_key, 'your api key for backpack goes here'
set :backpack_page, 'the backpack pages api you are saving to goes here'
 
get '/backpackit/*' do
url = params[:splat].first
doc = Pismo::Document.new(url)
title = '"' + doc.html_title + '":' + url
RestClient.post(settings.api_key,
{
:token => settings.backpack_page,
:note => { :title => title }
})
redirect url
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.