GithubHelp home page GithubHelp logo

upctoasin.com's Introduction

Note: My Amazon Associates account was closed, so the site was shutdown. You're welcome to fork this repo and use the code for your own projects, but the hosted site will not be returning.

UPCtoASIN.com

Build Status

UPCtoASIN.com -- A website to easily convert a UPC to an ASIN.

Features

  1. There is an sqlite database used for caching lookups.
  2. Requests to the Amazon API are throttled to 1 request/sec.

Installation

git clone [email protected]:AlexCline/upctoasin.com.git
cd upctoasin.com
npm install
make test
node app.js

Also needed is a file at conf/aws.conf with the following contents:

AWSAccessKeyId: YOURAWSACCESSID
AWSSecretKey: YOURAWSSECRETKEY
AWSTagId: YOURAWSASSOCTAGID

Mac OS X

You'll also need to specify the path to XCode before you run npm install. This is needed for the sqlite3 module.

sudo xcode-select --switch /usr/bin

CentOS

You'll need the following packages to build the required modules:

sudo yum install make

upctoasin.com's People

Contributors

alexcline avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

upctoasin.com's Issues

Tests failing, although credentials are correct

^Cubuntu@ip-172-31-36-91:~/upctoasin.com$ make test

UPCtoASIN.com -- Amazon Lookup Module
#lookup()
Error: [object Object]

  1) returns the correct ASIN for a known UPC (AWS)

Error: [object Object]

  2) returns an error for a UPC with multiple items (AWS)

Error: [object Object]

  3) returns an error for a UPC with no items (AWS)
#getLastReqTime()
  ✓ returns a timestamp 
#setLastReqTime()
  ✓ returns a timestamp 
#getConfig()
  ✓ has a non-null config object 
  ✓ has a valid log file location 
  ✓ has a valid dbpath 
#getAWSCredentials() (AWS)
  ✓ has a non-null creds object 
  ✓ has a valid AWSAccessKeyId value 
  ✓ has a valid AWSSecretKey value 
  ✓ has a valid AWSTagId value 

UPCtoASIN.com -- SQLite Caching Module
#lookup()
✓ returns null when looking up a UPC not in the db
✓ returns the ASIN of a UPC in the db
#cleanup()
✓ removes the test UPC/ASIN from the db
#cache()
✓ returns an error when saving a duplicate UPC/ASIN to the db
✓ returns a non-null object when saving a UPC/ASIN to the db
#getConfig()
✓ has a non-null config object
✓ has a valid database path
✓ has a valid test UPC
✓ has a valid test ASIN

18 passing (3s)
3 failing

  1. UPCtoASIN.com -- Amazon Lookup Module #lookup() returns the correct ASIN for a known UPC (AWS):
    Uncaught TypeError: Cannot read property 'Error' of undefined
    at /home/ubuntu/upctoasin.com/lib/amazon.js:42:58
    at /home/ubuntu/upctoasin.com/node_modules/apac/lib/OperationHelper.js:86:17
    at Parser. (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:384:20)
    at Parser.EventEmitter.emit (events.js:95:17)
    at Object.onclosetag (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:348:26)
    at emit (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/node_modules/sax/lib/sax.js:615:33)
    at emitNode (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/node_modules/sax/lib/sax.js:620:3)
    at closeTag (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/node_modules/sax/lib/sax.js:861:5)
    at Object.write (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/node_modules/sax/lib/sax.js:1294:29)
    at Parser.exports.Parser.Parser.parseString (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:403:31)
    at Parser.parseString (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:6:61)
    at Object.exports.parseString (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:433:19)
    at IncomingMessage. (/home/ubuntu/upctoasin.com/node_modules/apac/lib/OperationHelper.js:84:20)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)

  2. UPCtoASIN.com -- Amazon Lookup Module #lookup() returns an error for a UPC with multiple items (AWS):
    Uncaught TypeError: Cannot read property 'Error' of undefined
    at /home/ubuntu/upctoasin.com/lib/amazon.js:42:58
    at /home/ubuntu/upctoasin.com/node_modules/apac/lib/OperationHelper.js:86:17
    at Parser. (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:384:20)
    at Parser.EventEmitter.emit (events.js:95:17)
    at Object.onclosetag (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:348:26)
    at emit (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/node_modules/sax/lib/sax.js:615:33)
    at emitNode (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/node_modules/sax/lib/sax.js:620:3)
    at closeTag (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/node_modules/sax/lib/sax.js:861:5)
    at Object.write (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/node_modules/sax/lib/sax.js:1294:29)
    at Parser.exports.Parser.Parser.parseString (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:403:31)
    at Parser.parseString (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:6:61)
    at Object.exports.parseString (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:433:19)
    at IncomingMessage. (/home/ubuntu/upctoasin.com/node_modules/apac/lib/OperationHelper.js:84:20)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)

  3. UPCtoASIN.com -- Amazon Lookup Module #lookup() returns an error for a UPC with no items (AWS):
    Uncaught TypeError: Cannot read property 'Error' of undefined
    at /home/ubuntu/upctoasin.com/lib/amazon.js:42:58
    at /home/ubuntu/upctoasin.com/node_modules/apac/lib/OperationHelper.js:86:17
    at Parser. (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:384:20)
    at Parser.EventEmitter.emit (events.js:95:17)
    at Object.onclosetag (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:348:26)
    at emit (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/node_modules/sax/lib/sax.js:615:33)
    at emitNode (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/node_modules/sax/lib/sax.js:620:3)
    at closeTag (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/node_modules/sax/lib/sax.js:861:5)
    at Object.write (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/node_modules/sax/lib/sax.js:1294:29)
    at Parser.exports.Parser.Parser.parseString (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:403:31)
    at Parser.parseString (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:6:61)
    at Object.exports.parseString (/home/ubuntu/upctoasin.com/node_modules/apac/node_modules/xml2js/lib/xml2js.js:433:19)
    at IncomingMessage. (/home/ubuntu/upctoasin.com/node_modules/apac/lib/OperationHelper.js:84:20)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)

Any idea?

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.