GithubHelp home page GithubHelp logo

amazon-jp-auto-orderer's Introduction

Amazon JP Auto Orderer

Overview

This automates purchace from Amazon JP, worknig on AWS Lambda and PhantomJS.

Architecture is as below.

+--------------------------+
|                          |
| AWS Lambda (Node.js 4.3) |
|                          |
+------------+-------------+
             |
             | 1. execute as child process
             |
+------------v-------------+    2. crawl     +---------------+
|                          +---------------->|               |
|    PhantomJS (v2.1.1)    |                 |   Amazon JP   |
|                          |<----------------+               |
+--------------------------+                 +---------------+

Requirement

This works on Node.js v4.3 or newer.

This uses node-lambda for build and deploy lambda function.
To install node-lambda, execute following command.

npm install -g node-lambda

Install

git clone https://github.com/jsoizo/amazon-jp-auto-orderer.git
cd amazon-jp-auto-orderer

npm install

Usage

Local Development Environment

write .env file as below, and execute node-lambda run

AWS_ENVIRONMENT=development
AWS_ACCESS_KEY_ID=SOME_ACCESS_KEY
AWS_SECRET_ACCESS_KEY=SOME_ACCESS_SECRET
AWS_SESSION_TOKEN=
AWS_ROLE_ARN=
AWS_REGION=ap-northeast-1
AWS_FUNCTION_NAME=
AWS_HANDLER=index.handler
AWS_MODE=event
AWS_MEMORY_SIZE=512
AWS_TIMEOUT=60
AWS_DESCRIPTION=
AWS_RUNTIME=nodejs4.3
MODE=development
AMAZON_JP_EMAIL=[email protected]
AMAZON_JP_PASSWORD=Password
AMAZON_JP_ITEM_URL=http://www.amazon.co.jp/dp/XXXXXXXXX
CAPTURE_IMAGE_PATH=/tmp/one_click_order.png
CAPTURE_BUCKET=

on Production(AWS Lambda) Environment

write deploy.env file as below, and execute node-lambda run

MODE=production
AWS_REGION=ap-northeast-1
[email protected]
AMAZON_JP_PASSWORD=Password
AMAZON_JP_ITEM_URL=http://www.amazon.co.jp/dp/XXXXXXXXX
CAPTURE_IMAGE_PATH=/tmp/one_click_order.png
CAPTURE_BUCKET=any-bucket-name

Licence

MIT

Author

jsoizo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.