Bitcoin Forum
May 09, 2024, 07:38:48 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Auto-notify Script for Newegg 5830s (or any other site)  (Read 6304 times)
rethaw (OP)
Sr. Member
****
Offline Offline

Activity: 378
Merit: 255



View Profile
July 01, 2011, 07:09:21 AM
Last edit: July 01, 2011, 03:10:29 PM by rethaw
 #1

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="yourname@gmail.com" # change this
to_address="yourname@gmail.com" # and this
username="yourname@gmail.com" # 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!

1715283528
Hero Member
*
Offline Offline

Posts: 1715283528

View Profile Personal Message (Offline)

Ignore
1715283528
Reply with quote  #2

1715283528
Report to moderator
1715283528
Hero Member
*
Offline Offline

Posts: 1715283528

View Profile Personal Message (Offline)

Ignore
1715283528
Reply with quote  #2

1715283528
Report to moderator
1715283528
Hero Member
*
Offline Offline

Posts: 1715283528

View Profile Personal Message (Offline)

Ignore
1715283528
Reply with quote  #2

1715283528
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715283528
Hero Member
*
Offline Offline

Posts: 1715283528

View Profile Personal Message (Offline)

Ignore
1715283528
Reply with quote  #2

1715283528
Report to moderator
1715283528
Hero Member
*
Offline Offline

Posts: 1715283528

View Profile Personal Message (Offline)

Ignore
1715283528
Reply with quote  #2

1715283528
Report to moderator
1715283528
Hero Member
*
Offline Offline

Posts: 1715283528

View Profile Personal Message (Offline)

Ignore
1715283528
Reply with quote  #2

1715283528
Report to moderator
rethaw (OP)
Sr. Member
****
Offline Offline

Activity: 378
Merit: 255



View Profile
July 01, 2011, 07:52:18 AM
 #2

Well it worked, a batch came and went.

Good luck.

Keninishna
Hero Member
*****
Offline Offline

Activity: 556
Merit: 500



View Profile
July 01, 2011, 10:36:40 AM
 #3

Nice!! I could use this for some other things as well.
BkkCoins
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1009


firstbits:1MinerQ


View Profile WWW
July 01, 2011, 11:05:41 AM
 #4

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="user@gmail.com"
mailpwd="whatever"
mailmsg="Subject: NewEgg Video Cards in Stock\r\n\r\nCome and get 'em."
from="user@gmail.com"
to="user@gmail.com"

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

rethaw (OP)
Sr. Member
****
Offline Offline

Activity: 378
Merit: 255



View Profile
July 01, 2011, 02:42:18 PM
 #5

Gmail can send sms as well. You send to yoursmsnumber@yourcarrier.com.

Here is a list of the carrier addresses http://en.wikipedia.org/wiki/List_of_SMS_gateways.

BkkCoins
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1009


firstbits:1MinerQ


View Profile WWW
July 01, 2011, 02:48:01 PM
 #6

Gmail can send sms as well. You send to yoursmsnumber@yourcarrier.com.

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.

Acejam
Full Member
***
Offline Offline

Activity: 124
Merit: 251


View Profile
July 01, 2011, 03:45:54 PM
 #7

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/
rethaw (OP)
Sr. Member
****
Offline Offline

Activity: 378
Merit: 255



View Profile
July 01, 2011, 04:04:39 PM
 #8

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.

BkkCoins
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1009


firstbits:1MinerQ


View Profile WWW
July 01, 2011, 06:18:11 PM
 #9

Just got my SMS - Newegg has 5830s again in stock.

rethaw (OP)
Sr. Member
****
Offline Offline

Activity: 378
Merit: 255



View Profile
July 01, 2011, 06:21:56 PM
 #10

Wow already out again.

BkkCoins
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1009


firstbits:1MinerQ


View Profile WWW
July 01, 2011, 06:27:19 PM
Last edit: July 01, 2011, 07:03:59 PM by BkkCoins
 #11

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.

bleedkira
Member
**
Offline Offline

Activity: 83
Merit: 10



View Profile
July 01, 2011, 06:51:58 PM
 #12

They do.
CanaryInTheMine
Donator
Legendary
*
Offline Offline

Activity: 2352
Merit: 1060


between a rock and a block!


View Profile
July 01, 2011, 07:48:29 PM
 #13

For those not using Linux, see: http://forum.bitcoin.org/index.php?topic=24552.0
Mousepotato
Hero Member
*****
Offline Offline

Activity: 896
Merit: 1000


Seal Cub Clubbing Club


View Profile
July 01, 2011, 08:39:25 PM
 #14

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?

Mousepotato
rethaw (OP)
Sr. Member
****
Offline Offline

Activity: 378
Merit: 255



View Profile
July 01, 2011, 10:45:02 PM
 #15

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.

IlbiStarz
Full Member
***
Offline Offline

Activity: 336
Merit: 100



View Profile
July 03, 2011, 05:57:00 AM
 #16

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?
rethaw (OP)
Sr. Member
****
Offline Offline

Activity: 378
Merit: 255



View Profile
July 03, 2011, 06:02:21 AM
 #17

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.

ragingazn628
Hero Member
*****
Offline Offline

Activity: 714
Merit: 500


Coin Generator


View Profile WWW
January 26, 2012, 08:34:24 PM
 #18

how can I get this to work on windows?>
chungenhung
Legendary
*
Offline Offline

Activity: 1134
Merit: 1005


View Profile
January 27, 2012, 12:53:25 AM
 #19

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.
ragingazn628
Hero Member
*****
Offline Offline

Activity: 714
Merit: 500


Coin Generator


View Profile WWW
January 27, 2012, 01:04:47 AM
 #20

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?
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!