Sha256: 2d8bcee06100c015736a13890e7f3d91c6cbdea1bd467c03479de3008af5c7d2

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

#! /usr/bin/env ruby
# -*- coding: utf-8 -*-
#
# points.rb: getting mileages/points from shopping web sites.
#
# Copyright (C) 2012 by TADA Tadashi <t@tdtds.jp>
# Distributed under GPL.
#

require 'rubygems'
require 'points-scraper'
require 'thor'
require 'pit'

module Points::Scraper
	class App < Thor
		desc 'tpoint', 'getting current T-POINT from T-SITE.'
		def tpoint
			require 'points-scraper/tpoint'
			puts TPoint.new( *auth( 'tsite' ) ).start
		end

		desc 'ana', 'getting current ANA Mileage.'
		def ana
			require 'points-scraper/anamileage'
			puts AnaMileage.new( *auth( 'ana' ) ).start
		end

		desc 'rakuten', 'getting current Rakuten Points.'
		def rakuten
			require 'points-scraper/rakuten'
			puts Rakuten.new( *auth( 'rakuten' ) ).start
		end

		desc 'help', 'show command help.'
		def help
			super
		end

	private
		def auth( key )
			login = Pit::get( key, :require => {
				'user' => "your ID of #{key}.",
				'pass' => "your Password of #{key}."
			} )
			[login['user'], login['pass']]
		end
	end
end

Points::Scraper::App.start

# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:
# vim: ts=3

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
points-scraper-0.1.0 bin/points