Automating electonic part orders - node.js

Every few months my team creates a list of parts we couldn't have predicted we'd need. For a while we've been going to digikey and mouser, typing about 1000 searches in, and seeing what supplier has the right quantity.
But part shortages have made the "quantity available now" fluctuate considerably hour to hour, and sometimes even minute to minute. Is there a way to setup notifications for when products have a certain amount available?
I've tried webscraping digikey with nodejs, and making a little dashboard of link's that turn green when they're ready to buy. That worked for a while until Digikey blocked my IP address
I've considered using their API's, but they don't appear to offer buy if <logic> event setters, and only offer 1000 requests a day
mouser api
digikey api
What would be the best tool for the job?

Related

node.js InApp and schedule

I am doing a mobile game server using node.js. I used the Express and postgresql
I have two questions.
This game has a Inapp is 30 daily gems that user can get the gems in 30 days period. But I don't know how to implement the method let the server know the user bought this item and send the reward to this user every day.
This game has a special offer item in InApp. For example, a Christmas pack in 25/12 - 27/12. But I don't know how to set this 3 days can show this pack.
I am beginner in node.js. So I hope that you don't think my question is stupid. Thanks
Speaking at a high level, you have quite a few options.
For your gems requirement, you would probably have a field or table that represents this gem purchase, e.g a start date. If a user bought this package say on 1/1/2019 then your node server can have a process that runs once a day that queries the purchase table and give gems to any user where the current date is less than 30 days ahead of the purchased date.
Your table may look like:
user_id
date_purchased
gems_per_day
To implement this as a function that will run once a day, you may want to create a singular script for it and run it on a cron job once per day or create a Timer type class within Node that will run your function every 24 hours.
For your special offers, as part of your Store code, let's say you have a function that updates what items are currently available in the store, you run this code once per day (as one of the 2 methods mentioned above) and probably storing these items in your database. Similarly, you can check each day if the current date is within this "special offer period" and if it is, you can set that product within your database to be active.
Your table may look like:
product_id
enabled
or
product_id
start_dayMonth
end_dayMonth
Hope this gives you a few ideas of how you can lay this out. Happy to answer any questions

Ethics for obtaining a "fanatic" badge using the apscheduler and webbrowser module

So basically i have written a small python script that will automatically visit stackoverflow every day in the event that i am away for whatever reason or forget to visit the site. As much as i enjoy using this site on a daily basis, on several occasions i've reached over 50-60 consecutive days but the following day i have not visited stackoverflow for various reasons and my badge counter has been reset back to 0 and i have to start all over again, and i really want the fanatic badge!
Would this method of obtaining a fanatic badge be deemed as being against the true spirit of earning badges?

Developing Online multiplayer management game

I wish to create a college project on a simple online multiplayer management game which will involve players setting orders for the day/week and then obtaining profits. Being a relative beginner I am unable to figure out the architecture required for this task.
As far as I am concerned I would be needing the following things:
A text interface to display the status of ongoing events and to set orders in a web browser.
A certain application that would calculate the results every minute and update the database.
A database
Sorry for being so newbish, but any advice or links or books on how to proceed will do.
Please comment if any more information is required.
Any programming language would be fine. Pick a lang / arch you or someone in your group are familiar with. I'm mostly a PHP/ZF, Linux, Postgres guy. So I would...
Write a little ZendFramework app to collect your user's data and save to postgres database. I'd host it on a little Linux server. I like slicehost.com $20/mon, but there are cheaper. Or make friends with someone with a server.
Then for the update of the orders, use a cron job to run every minute. If the update process is complex, use another PHP script, else just straight SQL.
Why do you need to run updates every minute? Are people going to be updating it that often, if they are making orders for a day or week?
I would start with deciding on the equations that will be used in your model.
Then, that will help decide what you need in the database, to give the parameters to the model.
Then, once you have the database, you need to get information from the user, so decide what you need from the user.
For example you should have some random event that will make certain items go up or down in demand, or have resources become more common.
So, you may want to have information in the database that lists what each product is composed of.
If the model will have external information, or, if it is based on what others make, so, for example, last week shoes were not produced, so those that made shoes made a profit. This week everyone is making shoes, so there is too many, so the price went down.
This is why I think starting with your model, and testing your assumptions is the first step.
Any language, system, database will work well, just do what you feel comfy with. When you design the UI, do you want it to look fine on iphones and the Blackberry Razor? Then that will have a big impact on how you design the UI.

Tips on creating Burn down charts with Open Flash Chart 2

I am going to be implementing a burn down chart for our project management system. It's going to be using Open Flash Chart 2
The system knows when the project starts and when it's estimated to be completed. It also knows the story points and how many hours they each take.
Users write each day how many hours were worked on each story point they are assigned.
From the charts I've looked at, they usually show what the status is each day. And the projected completion date.
Should I expect each day to be 8 hours or 8 hours * users working. Or should i just show hours remaining and let the chart normalize itself (since many users can be working on it in the beginning and few at the end (or the opposite)
Has anyone created a burn down chart in open flash chart 2 and do you have any other tips for creating something like this.
The decision about how many hours constitute the sprint and what duration it will take is something that should be done at the sprint planning stage. Obviously the number of resources you have and the available hours they have each day will determine the total duration. Once you get to creating and updating your burndown chart you’ll be showing the total hours remaining on each day as opposed to breaking out the number of hours per day or number of resources; this has no bearing on the effort remaining (although obviously relates to the ability to complete that effort within the sprint period).
The issue you’ve raised is one of velocity; you’ll need to decide whether you’re working at a constant pace (same available resources over sprint duration) or variable pace (more resources up front, for example). Most burndown charts show a “steady pace” line so you might just need to think about what this looks like in a variable velocity sprint. I’m afraid I can’t comment directly on Open Flash Charts but hopefully the other info above is of use.

how does google analytics calculate metrics like "average time spent"?

how services like google analytics calculate parameters like
"average time spent"
"number of users that came to the website via search Vs user that hit the url directly
etc.
I would imagine that google can easily record a HIT when someone clicks on a link in serach result. But after that how long and deep the user is brwosing that perticular website is out of tap...hmmmm ?
This question has some information. As mentioned in that question time should be calculated using an onUnload() event. When the js is loaded firstime the time may be recorded (in cookies)and then onUnload() the time spent is calculated and sent to Google for record.
The above question explains most of your question.
This thread states quite clearly that there is no unLoad() event: http://groups.google.com/group/analytics-help-troubleshoot/browse_thread/thread/d142572ddf1fa9dd/38dd640f949e9890?pli=1
Also, try going to GA and look for sessions with only 1 pageview - you will see the average page time is 0s, which proves the point.

Resources