Author

Topic: Auto-notify Script for Newegg 5830s (or any other site) (Read 6360 times)

hero member
Activity: 714
Merit: 500
Coin Generator
how do I make it loop and run the script again after say 5 minutes? Instead of just closing.
If you're asking about my script then it has a loop built in. No need to run every 5 minutes because the script runs non-stop and checks once per minute.

I haven't tried yours yet but the other one it stops after the first change. Yours doesn't do that? Also do you know any good US sites for free SMS API? I tried signing up for the other one but it wouldn't let me Sad
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
how do I make it loop and run the script again after say 5 minutes? Instead of just closing.
If you're asking about my script then it has a loop built in. No need to run every 5 minutes because the script runs non-stop and checks once per minute.
hero member
Activity: 714
Merit: 500
Coin Generator
how do I make it loop and run the script again after say 5 minutes? Instead of just closing.
hero member
Activity: 714
Merit: 500
Coin Generator
What is smsapi? where can I get that

You really are looking for another LMGTFY link huh ?

what dat mean?

how can I make it so it checks multiple items?
sr. member
Activity: 406
Merit: 250
What is smsapi? where can I get that

You really are looking for another LMGTFY link huh ?
hero member
Activity: 714
Merit: 500
Coin Generator
What is smsapi? where can I get that
hero member
Activity: 714
Merit: 500
Coin Generator
I typed in:


sudo apt-get install curl


and it gave me this: (is it installed?)

Quote
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libcurl3
The following NEW packages will be installed:
  curl libcurl3
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 369 kB of archives.
After this operation, 987 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ oneiric-updates/main libcurl3 i386 7.21.6-3ubuntu3.2 [236 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ oneiric-updates/main curl i386 7.21.6-3ubuntu3.2 [134 kB]
Fetched 369 kB in 1s (277 kB/s)
Selecting previously deselected package libcurl3.
(Reading database ... 151563 files and directories currently installed.)
Unpacking libcurl3 (from .../libcurl3_7.21.6-3ubuntu3.2_i386.deb) ...
Selecting previously deselected package curl.
Unpacking curl (from .../curl_7.21.6-3ubuntu3.2_i386.deb) ...
Processing triggers for man-db ...
Setting up libcurl3 (7.21.6-3ubuntu3.2) ...
Setting up curl (7.21.6-3ubuntu3.2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

It is now.

o nice it worked just emailed me
sr. member
Activity: 406
Merit: 250
I typed in:


sudo apt-get install curl


and it gave me this: (is it installed?)

Quote
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libcurl3
The following NEW packages will be installed:
  curl libcurl3
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 369 kB of archives.
After this operation, 987 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ oneiric-updates/main libcurl3 i386 7.21.6-3ubuntu3.2 [236 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ oneiric-updates/main curl i386 7.21.6-3ubuntu3.2 [134 kB]
Fetched 369 kB in 1s (277 kB/s)
Selecting previously deselected package libcurl3.
(Reading database ... 151563 files and directories currently installed.)
Unpacking libcurl3 (from .../libcurl3_7.21.6-3ubuntu3.2_i386.deb) ...
Selecting previously deselected package curl.
Unpacking curl (from .../curl_7.21.6-3ubuntu3.2_i386.deb) ...
Processing triggers for man-db ...
Setting up libcurl3 (7.21.6-3ubuntu3.2) ...
Setting up curl (7.21.6-3ubuntu3.2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

It is now.
hero member
Activity: 714
Merit: 500
Coin Generator
I typed in:


sudo apt-get install curl


and it gave me this: (is it installed?)

Quote
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libcurl3
The following NEW packages will be installed:
  curl libcurl3
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 369 kB of archives.
After this operation, 987 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ oneiric-updates/main libcurl3 i386 7.21.6-3ubuntu3.2 [236 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ oneiric-updates/main curl i386 7.21.6-3ubuntu3.2 [134 kB]
Fetched 369 kB in 1s (277 kB/s)
Selecting previously deselected package libcurl3.
(Reading database ... 151563 files and directories currently installed.)
Unpacking libcurl3 (from .../libcurl3_7.21.6-3ubuntu3.2_i386.deb) ...
Selecting previously deselected package curl.
Unpacking curl (from .../curl_7.21.6-3ubuntu3.2_i386.deb) ...
Processing triggers for man-db ...
Setting up libcurl3 (7.21.6-3ubuntu3.2) ...
Setting up curl (7.21.6-3ubuntu3.2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
sr. member
Activity: 406
Merit: 250

First time using the internet, can't do your own research too ?

Give me a break.
hero member
Activity: 714
Merit: 500
Coin Generator
hero member
Activity: 714
Merit: 500
Coin Generator
how do I install curl?
sr. member
Activity: 406
Merit: 250
how can I get this to work on windows?>
it runs in linux.
you can install linux on a virtual machine, then you would be able to run it.

will it work on ubuntu?


Yes, Ubuntu is linux.
hero member
Activity: 714
Merit: 500
Coin Generator
how can I get this to work on windows?>
it runs in linux.
you can install linux on a virtual machine, then you would be able to run it.

will it work on ubuntu?
legendary
Activity: 1134
Merit: 1005
how can I get this to work on windows?>
it runs in linux.
you can install linux on a virtual machine, then you would be able to run it.
hero member
Activity: 714
Merit: 500
Coin Generator
how can I get this to work on windows?>
sr. member
Activity: 378
Merit: 255
If you're using gmail you don't have to change anything on that line. For another email server, yes, that is the only line you need to change. The changes that need to be made will depend on your specific service.

If you double that line you will need to enter a different to address in place of $to_address. It will allow you to send multiple emails.
full member
Activity: 336
Merit: 100
Do you also change the stuff in

curl -n --ssl-reqd --mail-from "<$from_address>" --mail-rcpt "<$to_address>" --url smtps://smtp.gmail.com:465 -T message.txt -u "$username:$password"

or only the stuff in the top? Can you also double that line to send 2 emails?
sr. member
Activity: 378
Merit: 255
Way too much work. Just use nowinstock.net. It's free and amazingly quick. I've picked up all my cards using the notification emails from them for 6990's on NewEgg.

http://www.nowinstock.net/computers/videocards/amd/6990/
Is there a way to get NowInStock.net to monitor for 5830s?

I set notifications for every site selling a 5850 or 5870. I haven't heard yet.

That being said I know the script I posted works and it can be modified to work with any page. Friend of mine picked up 2 5830s today.
hero member
Activity: 896
Merit: 1000
Seal Cub Clubbing Club
Way too much work. Just use nowinstock.net. It's free and amazingly quick. I've picked up all my cards using the notification emails from them for 6990's on NewEgg.

http://www.nowinstock.net/computers/videocards/amd/6990/
Is there a way to get NowInStock.net to monitor for 5830s?
donator
Activity: 2352
Merit: 1060
between a rock and a block!
member
Activity: 83
Merit: 10
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
I got two in my shopping cart.
But I have no idea if they get dumped out by other orders getting paid first.

Edit: I waited too long as I had to transfer money. They got snatched away. Blah.
They stayed in my cart for about a half hour.
sr. member
Activity: 378
Merit: 255
Wow already out again.
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
Just got my SMS - Newegg has 5830s again in stock.
sr. member
Activity: 378
Merit: 255
Thanks for that! It seems like they don't track 5830s, you can add as a custom it seems.

I imagine this script will be a bit quicker to the draw. You can modify the polling rate to your liking.
full member
Activity: 124
Merit: 251
Way too much work. Just use nowinstock.net. It's free and amazingly quick. I've picked up all my cards using the notification emails from them for 6990's on NewEgg.

http://www.nowinstock.net/computers/videocards/amd/6990/
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
Gmail can send sms as well. You send to [email protected].

Here is a list of the carrier addresses http://en.wikipedia.org/wiki/List_of_SMS_gateways.
I'm in Thailand and after looking around this was the only one I could find that works with my carrier.
I haven't even bought credits so it just sends a promo text when I use it - but that lets me know anyway.
sr. member
Activity: 378
Merit: 255
Gmail can send sms as well. You send to [email protected].

Here is a list of the carrier addresses http://en.wikipedia.org/wiki/List_of_SMS_gateways.
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
Yes, nice one!

I needed one like this to also send an SMS. You inspired me to take yours and modify it.
I simplified a bit and added details for SMS using the Clickatell api.

I comment out the echo dots and msg because I run it in background using "&" so I don't keep open a console.

Code:
#!/bin/bash

url="http://content.newegg.com/LandingPage/ItemInfo4ProductDetail.aspx?Item=N82E16814102878"
txt="OUT OF STOCK"

mailsrv="smtps://smtp.gmail.com:465"
mailuser="[email protected]"
mailpwd="whatever"
mailmsg="Subject: NewEgg Video Cards in Stock\r\n\r\nCome and get 'em."
from="[email protected]"
to="[email protected]"

smsuser="userid"
smspwd=""
smsapi="apicode"
smsphone="phonenumber"
smsmsg="NewEgg Video Cards in Stock"

#echo "Checking newegg for video cards"
while [ -z "`wget -qO- "$url" | grep "$txt"`" ]; do
#  echo -n "."
  sleep 1m
done

if [ -n "$smspwd" ]; then
  wget "http://api.clickatell.com/http/sendmsg?user=$smsuser&password=$smspwd&api_id=$smsapi&to=$smsphone&text=$smsmsg"
fi

if [ -n "$mailpwd" ]; then
  printf "$mailmsg" | curl -n --ssl-reqd --mail-from "<$from>" --mail-rcpt "<$to>" --url "$mailsrv" -T - -u "$mailuser:$mailpwd"
fi
hero member
Activity: 556
Merit: 500
Nice!! I could use this for some other things as well.
sr. member
Activity: 378
Merit: 255
Well it worked, a batch came and went.

Good luck.
sr. member
Activity: 378
Merit: 255
Newegg's auto-notify is worthless. I wrote this script that you can run on your linux miner box that will check the stock of the Sapphire 5830s and email you with a link to the newegg page if it comes in stock.

It checks every minute. It is currently set up to use a gmail address but you can change this to work with your server.

You firstly need curl, this is an application that will handle the connection to gmail. For debian/ubuntu:

Code:
sudo apt-get install curl

Now open your favorite text editor (vi, gedit, etc.) and paste the following code:

Code:
from_address="[email protected]" # change this
to_address="[email protected]" # and this
username="[email protected]" # and this
password="yourpass" #            this too
echo -n "Checking newegg for video cards"
echo "Subject: Video card update

Go buy some video cards, hurry! http://www.newegg.com/Product/Product.aspx?Item=N82E16814102878&cm_re=5830-_-14-102-878-_-Product
" > message.txt
running=true; while $running; do
echo -n "."
sleep 1m
if [ -z "`wget -qO- http://content.newegg.com/LandingPage/ItemInfo4ProductDetail.aspx?Item=N82E16814102878 | grep "OUT OF STOCK"`" ]
then
echo "In stock! Sending an email."
curl -n --ssl-reqd --mail-from "<$from_address>" --mail-rcpt "<$to_address>" --url smtps://smtp.gmail.com:465 -T message.txt -u "$username:$password"
running=false
rm message.txt
fi
done

You will need to edit the relevant top lines to reflect your email address and password. Now save it as "check.sh".

Then, from a command prompt "cd" to the folder where it is saved and enter:

Code:
sh check.sh

OK it's checking, you should see:

Code:
Checking newegg for video cards...

Where a "." is printed every time it checks. Leave this terminal running as long as you would like to check. It will quit if the product no longer says "OUT OF STOCK". Feel free to modify this code to check for another card. If you can't figure it out I can help out with those modifications.

I am hoping those who choose to use this aren't just turning around to sell on ebay, and good luck!
Jump to: