ricepaper 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.txt +4 -0
- data/bin/ricepaper +41 -0
- metadata +55 -0
data/README.txt
ADDED
data/bin/ricepaper
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# CLI interface to adding articles to your instantpaper account
|
4
|
+
# by Matthew Lee Hinman (http://writequit.org)
|
5
|
+
|
6
|
+
require 'ricepaper'
|
7
|
+
require 'optparse'
|
8
|
+
|
9
|
+
|
10
|
+
opthash = Hash.new
|
11
|
+
options = OptionParser.new do |opts|
|
12
|
+
opts.banner = %q|Usage: #{$0} [options] "<url>" ["<url>" "<url>" ...]|
|
13
|
+
opts.on("-u", "--username [USER]", "Username") { |opt| opthash['username'] = opt }
|
14
|
+
opts.on("-p", "--password [PASS]", "Password") { |opt| opthash['password'] = opt }
|
15
|
+
opts.on("-a", "--authenticate", "Only attempt to authenticate to Instapaper") { |opt| opthash['authenticate'] = opt }
|
16
|
+
opts.on("-t", "--title [TITLE]", "Optional title for instantpaper entry") { |opt| opthash['title'] = opt }
|
17
|
+
end
|
18
|
+
|
19
|
+
options.parse!(ARGV)
|
20
|
+
rp = RicePaper.new(opthash['username'],opthash['password'])
|
21
|
+
|
22
|
+
if opthash['authenticate']
|
23
|
+
print "Authenticating... "
|
24
|
+
result = rp.authenticate
|
25
|
+
|
26
|
+
puts result ? "Successful." : "Failed."
|
27
|
+
puts "Error: #{rp.error}" unless result
|
28
|
+
exit(0)
|
29
|
+
end
|
30
|
+
|
31
|
+
if ARGV.size < 1
|
32
|
+
puts "I need a url to add to InstantPaper"
|
33
|
+
end
|
34
|
+
|
35
|
+
ARGV.each do |url|
|
36
|
+
print "Submitting '#{url}' #{opthash['title'].nil? ? "" : "with title '#{opthash['title']}'"} ... "
|
37
|
+
result = rp.add(url,opthash['title'])
|
38
|
+
|
39
|
+
puts result ? "Successful." : "Failed."
|
40
|
+
puts "Error: #{rp.error}" unless result
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ricepaper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Lee Hinman
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-06-10 00:00:00 -06:00
|
13
|
+
default_executable: ricepaper
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Ricepaper is a library that allows you to add URLs to Instapaper, either by using it as a CLI or as a Ruby library.
|
17
|
+
email: lee@writequit.org
|
18
|
+
executables:
|
19
|
+
- ricepaper
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.txt
|
24
|
+
files:
|
25
|
+
- README.txt
|
26
|
+
has_rdoc: true
|
27
|
+
homepage: http://github.com/dakrone/ricepaper
|
28
|
+
licenses: []
|
29
|
+
|
30
|
+
post_install_message:
|
31
|
+
rdoc_options:
|
32
|
+
- --charset=UTF-8
|
33
|
+
require_paths:
|
34
|
+
- lib
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: "0"
|
40
|
+
version:
|
41
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: "0"
|
46
|
+
version:
|
47
|
+
requirements: []
|
48
|
+
|
49
|
+
rubyforge_project: writequit
|
50
|
+
rubygems_version: 1.3.4
|
51
|
+
signing_key:
|
52
|
+
specification_version: 3
|
53
|
+
summary: A small library for adding URLs to Instapaper
|
54
|
+
test_files: []
|
55
|
+
|