Project with JavaScript

I am new to coding and I am currently learning JavaScript. I want to make something to check the balance on Wal Mart Gift Cards. Like a program to input say 100 gift card numbers and pins and twice a day at a certain set time the program will check those numbers and pins and return the balance on those card numbers. Is that something that can be done with JavaScript? or would I need PHP?

You will probably want a server-side application to do this (you can create a server-side application in many languages: PHP, Ruby, Python, Haskell, Java, etc.). This will allow you to schedule the tasks (for example using cron in Linux), store given card numbers and pins, store the balance or process the balance (send via email to the given user). If this is a personal project, only you will be using this (you don’t want to serve numerous users) then it might even make sense to simply write a bash script to do this.

Either way, this is not something that you would normally do on the client-side (JavaScript), although you might use Node.js to create a server-side application using JavaScript.

Before jumping into this project please make sure that there is a programmatic way to retrieve the balance of the gift card. Usually, in order to get this kind of information, the provider of the cards must expose public API (application programming interface) that will allow you to simply query the provided service to check the balance.

If the given provider does not expose an API then it might be problematic to check the balance from within your application. Browser automation / scripted headless browsers usually fail to perform this kind of actions because of all sorts of CAPTCHA systems.

1 Like

yeah it would be just for my own personal use. it would be wal mart gift cards and im pretty sure their API is accessible

1 Like

In that case, I would probably tackle this problem as follow:

  1. create a JSON, YAML or CSV file that will include all the credit numbers and pins;
  2. create a script (in any language, Python, Ruby, JavaScript etc.) that will read the file and for each card number will query the API to get the balance;
  3. sum all balances, append the sum to the end of the output file (you can also add a timestamp);
  4. add a cron job that will execute the created script every 12 hours.
1 Like