Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added examples for example usage.

  • Loading branch information...
commit 1f5cac8ec31461d71182044d2c8b4adbd0ee57fb 1 parent 3573b48
dakrone authored
Showing with 32 additions and 0 deletions.
  1. +18 −0 examples/add_sites.rb
  2. +14 −0 examples/authentication_test.rb
View
18 examples/add_sites.rb
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+#
+# Add sites to Instapaper using Ricepaper
+#
+
+require 'ricepaper'
+
+rp = RicePaper.new("username", "password")
+
+sites = [
+ "http://google.com",
+ "http://ruby-lang.org",
+ "http://instapaper.com"
+]
+
+sites.each { |site|
+ puts "Added #{site}." if rp.add(site)
+}
View
14 examples/authentication_test.rb
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+#
+# Test authenticating the user to Instapaper
+#
+
+require 'ricepaper'
+
+rp = RicePaper.new("username", "password")
+
+if rp.authenticate
+ puts "Authentication successfull."
+else
+ puts "Authentication failed."
+end
Please sign in to comment.
Something went wrong with that request. Please try again.