├── README.md └── pinboard-list-export.rb /README.md: -------------------------------------------------------------------------------- 1 | Pinboard List Export 2 | ==================== 3 | 4 | Exports a list of links, filtered by at least one tag, from a [Pinboard](https://pinboard.in) account. Currently supports HTML, Markdown, Textile, MediaWiki-markup, and pure text as output formats. 5 | 6 | Homepage: http://github.com/hng/pinboard-list-export 7 | 8 | Usage 9 | ----- 10 | 11 | Usage: pinboard-list-export.rb [options] 12 | -t, --tags TAGS pinboard tags to export into list (separated by comma) 13 | -u, --user USER pinboard username 14 | -p, --password PASSWORD pinboard password 15 | -f, --format FORMAT output format: html (default), markdown, textile, wiki, text 16 | -h, --help Displays this screen 17 | 18 | Dependencies 19 | ------------ 20 | 21 | pinboard gem (>= 0.0.3): 22 | 23 | gem install pinboard 24 | 25 | License 26 | ------- 27 | 28 | Copyright (C) 2011 Henning Schumann 29 | 30 | MIT-License: 31 | 32 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 33 | 34 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 35 | 36 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 37 | -------------------------------------------------------------------------------- /pinboard-list-export.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # pinboard-list-export.rb 4 | # 5 | # 6 | # Created by Henning Schumann 7 | # Copyright 2011 Henning Schumann. MIT-License (see README). 8 | # 9 | # Homepage: http://github.com/hng/pinboard-list-export 10 | # Usage: See pinboard-list-export.rb --help 11 | 12 | require 'optparse' 13 | require 'pinboard' 14 | 15 | @options = {} 16 | 17 | optparse = OptionParser.new do |opts| 18 | opts.banner = "Usage: pinboard-list-export.rb [options]" 19 | 20 | @options[:tags] = false 21 | opts.on('-t', '--tags TAGS', 'pinboard tags to export into list (separated by comma)') do |tags| 22 | @options[:tags] = tags 23 | end 24 | 25 | @options[:user] = false 26 | opts.on('-u', '--user USER', 'pinboard username') do |user| 27 | @options[:user] = user 28 | end 29 | 30 | @options[:password] = false 31 | opts.on('-p', '--password PASSWORD', 'pinboard password') do |pwd| 32 | @options[:password] = pwd 33 | end 34 | 35 | @options[:format] = false 36 | opts.on('-f', '--format FORMAT', 'output format: html (default), markdown, textile, wiki, text') do |f| 37 | @options[:format] = f 38 | end 39 | 40 | opts.on('-h', '--help', 'Displays this screen') do 41 | puts opts 42 | exit 43 | end 44 | 45 | end 46 | 47 | optparse.parse! 48 | 49 | @output = "" 50 | 51 | if(!@options[:format] || @options[:format] == "html") 52 | @output << "