Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Sinatra app for saving links to Backpack
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.