Coder Social home page Coder Social logo

find-iphone-7's Introduction

find-iphone-7 🕵🏻📱

simple CLI to check for available iphone 7's near you. Built because I didn't want to have to keep checking the site to see when there'd be an iphone 7 (plus) available in my area.

install:

λ yarn global add find-iphone-7

or

λ npm i -g find-iphone-7

Example

Find black iphone 7 plus's in my zipcode w/ ATT

λ find-iphone-7 --zip 12345 --model plus --color black --capacity 256 --carrier att --watch --notify

Usage

λ find-iphone-7 --zip 12345 --model plus --color black --capacity 256 --carrier att --watch --notify

CLI Params:

--zip [zip number]
--model [seven | plus string]
--carrier [att | verizon | tmobile | sprint  string]
--color [jetBlack | black | gold | silver | rose string]
--capacity [32 | 128 | 256 number]

--watch runs a check every minute
--notify will send you a text message when there's one available

If you provide the notify flag, you need to set up an iphone.yaml file that'll let twilio send you a text w/ the info about

TWILIO_ACCOUNT: <account>
TWILIO_TOKEN: <token>
TO_NUMBER: <your number>
FROM_NUMBER: <your twilio number>

find-iphone-7's People

Contributors

markthethomas avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

find-iphone-7's Issues

yargs Incorrectly parses zip codes starting with a '0'

Zip codes which start with a "0" (zero) are incorrectly parsed and the leading zero is dropped from the result. E.g. 01234 becomes 1234 which is no longer a valid zip code.

I was also getting errors that I was missing an iphone7.yaml file until I stubbed one out even though I was not using the notify flag.

Cool script though! Nice job

 ~> find-iphone-7 --zip 07030 --model plus --color black --capacity 128 --carrier att

argv:  { _: [],
  zip: 7030,
  model: 'plus',
  color: 'black',
  capacity: 128,
  carrier: 'att',
  '$0': '/usr/local/bin/find-iphone-7' }
⠹ Searching for iphones...
availability payload: { overlayInitiatedFromWarmStart: false,
  viewMoreHoursLinkText: 'View more hours',
  little: true,
  errorMessage: 'Invalid Zip Code or City/State.',
  location: '7030' }
TypeError: Cannot read property 'filter' of undefined
    at axios.get.then (/usr/local/lib/node_modules/find-iphone-7/index.js:111:47)
    at process._tickCallback (internal/process/next_tick.js:103:7)
⠧ Searching for iphones...⏎                                                     

 ~> find-iphone-7 --zip '07030' --model plus --color black --capacity 128 --carrier att

argv:  { _: [],
  zip: 7030,
  model: 'plus',
  color: 'black',
  capacity: 128,
  carrier: 'att',
  '$0': '/usr/local/bin/find-iphone-7' }
⠙ Searching for iphones...
availability payload: { overlayInitiatedFromWarmStart: false,
  viewMoreHoursLinkText: 'View more hours',
  little: true,
  errorMessage: 'Invalid Zip Code or City/State.',
  location: '7030' }
TypeError: Cannot read property 'filter' of undefined
    at axios.get.then (/usr/local/lib/node_modules/find-iphone-7/index.js:111:47)
    at process._tickCallback (internal/process/next_tick.js:103:7)
⠦ Searching for iphones...^C⏎                                                   
 ~>

Above you can see two trials where I'm logging out the argv variable and the api response. Only difference between the two trials is the second wraps the zip arg in single quotes. Both incorrectly parse the zip code and the error returned from the API refers to the incorrect zip code.

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.