8000 GitHub - TJamesCorcoran/lulu_remote
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

TJamesCorcoran/lulu_remote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LuluRemote

Lulu.com is a print publisher.

This Ruby / Rails library helps you interact with their website.

The API lets you:

  • place orders

Installation

  1. add this to your Gemfile

    gem "lulu_remote", :git =>"http://github.com/TJamesCorcoran/lulu_remote"
    
  2. at the command line type

    sudo apt-get install qt5-qmake
    bundle install
  3. get a username and password from Lulu

  4. Using credentials from previous step, add this to your config/application.rb

    LuluRemote.configure do |config|
      config.username                      = 'tru<x>'   
      config.password                      = '<y>'
    end
    
  5. That’s it. You can now begin interacting with the Lulu website programatically. Here’s a sample program to get you started:

    B1_HARD  = "http://www.lulu.com/shop/travis-j-i-corcoran/book-1-hardcover/hardcover/product-23262551.html"
    B2_HARD  = "http://www.lulu.com/shop/travis-j-i-corcoran/book-2-hardcover/hardcover/product-23262547.html"
    

def error_check(ret) if ! ret puts “*** #{ret}” end end

LuluRemote.login do
  ret = LuluRemote.empty_cart
  error_check(ret)

  ret = LuluRemote.add_book_to_cart(B1_HARD)
  error_check(ret)

  ret = LuluRemote.add_coupon("LULU15")
  error_check(ret)

  ret = LuluRemote.start_checkout
  error_check(ret)

  ret = LuluRemote.add_address("Random Eddie", "100 Quaker St", nil, "Weare", "NH", "02474", "603 529 3462", "US")
  error_check(ret)

  ret = LuluRemote.choose_shipping_option
  error_check(ret)

  ret = LuluRemote.billing("621")
  error_check(ret)

  ret = LuluRemote.review
  error_check(ret)

  puts "order = #{ret[:order_num]} ; price = #{ ret[:total_price].to_currency}"

end

Development

To develop this library

cd <location>
rails new <fake_app_name>
cd <fake_app_name>
edit Gemfile to contain
	   gem "lulu_remote",                         :path => "/home/tjic/personal/writing/ari/src/lulu_remote/Gemfile"
rails console  	   
LuluRemote.login

Use: Place Orders

# 
#
LuluRemote.get_lulu_release_dates(["JAN152628", "JAN152627"] )
=> {"JAN152628"=>Wed, 04 Mar 2015, 
   "JAN152627"=>Wed, 04 Mar 2015}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0