01-16-2013 01:19 PM
66 123
tools
  1. six8's Avatar
    So I wrote a quick python script this morning that I will leave running all day that will check both the Nexus 8GB and Nexus 16GB pages to see if anything on the pages has changed (MD5 Hash). If it has, it will email you as soon as the page changes. I wrote this so I don't have to sit there all day killing my F5 key. Here's the code:

    Code:
    import urllib
    import hashlib
    import time
    import smtplib
    import string
    
    google_pages = {'https://play.google.com/store/devices/details?id=nexus_4_8gb':'6563c52c9711cb614c9daffdc9c55ee5', 'https://play.google.com/store/devices/details?id=nexus_4_16gb':'1aab1c70346b85075c0c63166c044eb7'}
    
    count = 0
    
    while True:
    count += 1
    if not count % 60:
    print 'Ran: %s' % count
    time.sleep(30)
    for google_page in google_pages.keys():
    page_file = urllib.urlopen(google_page)
    page_html = page_file.read()
    page_md5 = hashlib.md5(page_html).hexdigest()
    if page_md5 != google_pages[google_page]:
    
    #MAKE SURE TO REPLACE THE LINE BELOW WITH YOUR EMAIL
    email = 'youremail@example.com'
    
    server = smtplib.SMTP('localhost')
    
    msg = string.join((
    "From: %s" % email,
    "To: %s" % email,
    "Subject: %s" % 'NEXUS 4 ON SALE',
    "",
    "NEXUS 4 ON SALE! MD5 %s DOES NOT MATCH %s\n\n%s" % (page_md5, google_pages[google_page], google_page)
    ), "\r\n")
    
    server.sendmail(email, email, msg)
    server.quit()
    exit()
    *mindblown

    Sent from my SAMSUNG-SGH-I317 using Tapatalk 2
    philtann likes this.
    11-12-2012 07:54 PM
  2. squadz's Avatar
    Page Monitor just said something changed, I'm thinking it was the Twitter count because I see nothing else?
    11-12-2012 08:10 PM
  3. BCVisin's Avatar
    Page Monitor just said something changed, I'm thinking it was the Twitter count because I see nothing else?
    Strange...I didn't get an email from my script...got one a while ago and posted...But I saw nothing change either.
    11-12-2012 08:13 PM
  4. dutchtrumpet#AC's Avatar
    Bumper added

    Sent from my Nexus 7 using Android Central Forums
    six8 likes this.
    11-12-2012 08:14 PM
  5. jeremydc's Avatar
    Awesome, man concern answered.
    11-12-2012 08:24 PM
  6. BCVisin's Avatar
    Anyone who wants can send/message me their email address and I can easily add it to my script so you don't have to run it. You will be notified any time the Nexus 4 page (8 or 16GB) changes.

    -Blake
    11-12-2012 08:25 PM
  7. squadz's Avatar
    Bumper added

    Sent from my Nexus 7 using Android Central Forums
    Good find, missed that. Not interested in a bumper though.
    11-12-2012 08:29 PM
  8. jeremydc's Avatar
    Quick question. When a change occurs and the window is minimized, will there be a notification sound/ blinking? About to watch MNF
    11-12-2012 08:31 PM
  9. trter10-imore's Avatar
    I'm not too sure they'll update the webpage itself but rather where it gets its info from, kind of like an embed.

    edit- just took a look at the html and it is actually hard-coded in the webpage.

    Code:
    <div class="coming-soon-text">Coming Soon</div><div class="sign-up-text hardware-small-print">Sign up to be notified by email when Nexus 4 (8GB) becomes available.</div><form id="backorder-signup-form" method="post" enctype="multipart/form-data" action="https://services.google.com/fb/forms/playnexusoptin/" target="_blank"><input type="text" name="email" id="backorder-signup-email" class="sign-up-form hint-textbox" label="Email address" /><div class="hardware-form-submit-border"><input type="submit" id="backorder-submit-button" class="hardware-form-submit border-box" value="Notify me"/>
    11-12-2012 09:01 PM
  10. yukichi's Avatar
    I tried running it and got an error with this line:

    server = smtplib.SMTP('localhost')

    The error when I execute the script is:

    Traceback (most recent call last):
    File "nexuscheck.py", line 25, in <module>
    server = smtplib.SMTP('localhost')
    File "C:\Python27\lib\smtplib.py", line 249, in __init__
    (code, msg) = self.connect(host, port)
    File "C:\Python27\lib\smtplib.py", line 309, in connect
    self.sock = self._get_socket(host, port, self.timeout)
    File "C:\Python27\lib\smtplib.py", line 284, in _get_socket
    return socket.create_connection((port, host), timeout)
    File "C:\Python27\lib\socket.py", line 571, in create_connection
    raise err
    socket.error: [Errno 10061] No connection could be made because the target machi
    ne actively refused it

    How do I fix this?
    11-12-2012 09:22 PM
  11. BCVisin's Avatar
    I tried running it and got an error with this line:

    server = smtplib.SMTP('localhost')

    The error when I execute the script is:

    Traceback (most recent call last):
    File "nexuscheck.py", line 25, in <module>
    server = smtplib.SMTP('localhost')
    File "C:\Python27\lib\smtplib.py", line 249, in __init__
    (code, msg) = self.connect(host, port)
    File "C:\Python27\lib\smtplib.py", line 309, in connect
    self.sock = self._get_socket(host, port, self.timeout)
    File "C:\Python27\lib\smtplib.py", line 284, in _get_socket
    return socket.create_connection((port, host), timeout)
    File "C:\Python27\lib\socket.py", line 571, in create_connection
    raise err
    socket.error: [Errno 10061] No connection could be made because the target machi
    ne actively refused it

    How do I fix this?
    It's because you are not running a smtp server (postfix or sendmail) on your local computer. You can either figure it out by changing the code like this: Kutuma's Ramblings: Sending emails via Gmail with Python

    OR (better option) give me your email address, so my script will CC you when it emails me (probably at 12:00 AM PST tonight)

    -Blake
    11-12-2012 09:34 PM
  12. philtann's Avatar
    This is awesome, thanks so much!
    11-12-2012 09:40 PM
  13. i2y4n's Avatar
    Good find, missed that. Not interested in a bumper though.
    The little box callout that said "Available to order on November 13th" was taken down too.
    11-12-2012 09:42 PM
  14. yukichi's Avatar
    It's because you are not running a smtp server (postfix or sendmail) on your local computer. You can either figure it out by changing the code like this: Kutuma's Ramblings: Sending emails via Gmail with Python

    OR (better option) give me your email address, so my script will CC you when it emails me (probably at 12:00 AM PST tonight)

    -Blake
    I am curious on setting it up for my machine. Any equivalent to postfix or sendmail recommended for windows?
    11-12-2012 09:42 PM
  15. marty331's Avatar
    It's because you are not running a smtp server (postfix or sendmail) on your local computer. You can either figure it out by changing the code like this: Kutuma's Ramblings: Sending emails via Gmail with Python

    OR (better option) give me your email address, so my script will CC you when it emails me (probably at 12:00 AM PST tonight)

    -Blake
    I got the same error. Would you mind adding my email? marty331@gmail.com
    11-12-2012 09:52 PM
  16. BCVisin's Avatar
    I am curious on setting it up for my machine. Any equivalent to postfix or sendmail recommended for windows?
    Only one I have ever used was IndigoStar Software - IndigoMail (SendMail for Windows)

    And that was like a LONG time ago. I stopped using Windows like 3 years ago and moved over to Ubuntu.

    Search google for "sendmail for windows"
    11-12-2012 09:53 PM
  17. BCVisin's Avatar
    WOW, I can't believe how many requests I have gotten from people to add their email! I am up to 20! Also, I am adding them as fast as they are coming in, although I keep getting this:
    This forum requires that you wait 120 seconds between sending private messages.
    when I try and reply that is is added, so bear with me as I reply to you all. Also, expect an email from Blake@oybro.com (coming from my local box, so no DKIM or SPF records set up <-- meaning it will likely look like spam but It seems to get through to my @gmail account easily enough.

    -Blake
    11-12-2012 09:58 PM
  18. BCVisin's Avatar
    I got the same error. Would you mind adding my email? marty331@gmail.com
    You got it Marty!
    11-12-2012 10:05 PM
  19. donec's Avatar
    That's cool but Firefox has an extension that already does that....
    https://addons.mozilla.org/en-us/fir.../check4change/
    11-12-2012 10:08 PM
  20. BCVisin's Avatar
    Ya, We already saw that in the beginning of this post. Actually the thread about that is here: http://forums.androidcentral.com/goo...p-tonight.html

    I just sent out a test email so if any of you who sent me your email did not get it, unblock me from your spam filter!

    Also, I was told to use BCC, which I am now doing.

    EDIT: I mean I am "NOW doing"
    11-12-2012 10:13 PM
  21. jpprice's Avatar
    Could you add me to the list? Nytefire07@gmail.com?
    11-12-2012 10:50 PM
  22. Ziptied's Avatar
    Could you add me to the list? Nytefire07@gmail.com?
    Hey, my wife is from Statesboro. I was just there a week ago.
    11-12-2012 10:51 PM
  23. jpprice's Avatar
    Hey, my wife is from Statesboro. I was just there a week ago.
    Really? Lived here most of my life. Small world
    11-12-2012 10:54 PM
  24. Ziptied's Avatar
    Really? Lived here most of my life. Small world
    I find myself saying that more and more.....
    11-12-2012 10:55 PM
  25. BCVisin's Avatar
    So they keep changing the page...not sure what it is, but I don't want to flood all of you with false emails, so I am actively working on adding a diff script so we know what changed on the page.
    Ziptied likes this.
    11-12-2012 11:04 PM
66 123

Similar Threads

  1. Technically isn't it incorrect to say you are hacking the GNex?
    By CarryMe in forum Verizon Galaxy Nexus Rooting, ROM's, and Hack's
    Replies: 10
    Last Post: 01-04-2012, 09:50 AM
  2. Are you able to use bluetooth while in the car dock?
    By katrina2475 in forum Motorola Droid X
    Replies: 14
    Last Post: 09-14-2010, 08:11 AM
  3. Way to kill off the EVO:( Sprint & HTC this is on you!!!
    By widdlewade in forum HTC EVO 4G Rooting, ROMs, and Hacks
    Replies: 30
    Last Post: 08-26-2010, 08:03 PM
  4. How to unroot so you can download the official froyo when it comes out
    By Murraysj09 in forum Incredible Rooting, ROMs, and Hacks
    Replies: 30
    Last Post: 07-27-2010, 10:07 PM
  5. Replies: 3
    Last Post: 01-29-2010, 05:55 PM
LINK TO POST COPIED TO CLIPBOARD