Welcome to the Android Central Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 66
Like Tree14Likes
  1. #26  
    six8's Avatar

    Posts
    156 Posts
    Global Posts
    158 Global Posts

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quote Originally Posted by BCVisin View Post
    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
    Thanked by:
  2. #27  
    squadz's Avatar

    Posts
    156 Posts
    Global Posts
    271 Global Posts

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Page Monitor just said something changed, I'm thinking it was the Twitter count because I see nothing else?
  3. Thread Author  Thread Author    #28  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quote Originally Posted by squadz View Post
    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.
  4. #29  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Bumper added

    Sent from my Nexus 7 using Android Central Forums
    six8 likes this.
  5. #30  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Awesome, man concern answered.
  6. Thread Author  Thread Author    #31  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    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
    Thanked by 4:
  7. #32  
    squadz's Avatar

    Posts
    156 Posts
    Global Posts
    271 Global Posts

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quote Originally Posted by dutchtrumpet#AC View Post
    Bumper added

    Sent from my Nexus 7 using Android Central Forums
    Good find, missed that. Not interested in a bumper though.
  8. #33  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quick question. When a change occurs and the window is minimized, will there be a notification sound/ blinking? About to watch MNF
  9. #34  
    trter10-imore's Avatar
    ThunderboltTool Developer

    Posts
    744 Posts
    ROM
    Liquid JB v2.1 Alpha6

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    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"/>


    Quote Originally Posted by o0cdiddy View Post
    ...we should rename the TB the Menstrualbolt
    If you like something i have done and would like to contribute my nerd fund, you may do so here
  10. #35  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    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. Thread Author  Thread Author    #36  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quote Originally Posted by yukichi View Post
    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
  12. #37  
    philtann's Avatar

    Posts
    9 Posts
    ROM
    4.0.4

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    This is awesome, thanks so much!
  13. #38  
    i2y4n's Avatar

    Posts
    5 Posts
    Global Posts
    276 Global Posts

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quote Originally Posted by squadz View Post
    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.
  14. #39  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quote Originally Posted by BCVisin View Post
    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?
  15. #40  
    marty331's Avatar

    Posts
    47 Posts
    Global Posts
    48 Global Posts

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quote Originally Posted by BCVisin View Post
    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
  16. Thread Author  Thread Author    #41  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quote Originally Posted by yukichi View Post
    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"
  17. Thread Author  Thread Author    #42  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    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
  18. Thread Author  Thread Author    #43  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quote Originally Posted by marty331 View Post
    I got the same error. Would you mind adding my email? marty331@gmail.com
    You got it Marty!
  19. #44  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    That's cool but Firefox has an extension that already does that....
    https://addons.mozilla.org/en-us/fir.../check4change/
  20. Thread Author  Thread Author    #45  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Ya, We already saw that in the beginning of this post. Actually the thread about that is here: Small tip for those staying up tonight...

    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"
    Last edited by BCVisin; 11-12-2012 at 09:24 PM.
  21. #46  
    jpprice's Avatar

    Posts
    441 Posts
    Global Posts
    446 Global Posts

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Could you add me to the list? Nytefire07@gmail.com?
  22. #47  
    Ziptied's Avatar
    Your Resident Googler

    Posts
    536 Posts
    Global Posts
    768 Global Posts
    ROM
    Stock

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quote Originally Posted by jpricesd View Post
    Could you add me to the list? Nytefire07@gmail.com?
    Hey, my wife is from Statesboro. I was just there a week ago.
  23. #48  
    jpprice's Avatar

    Posts
    441 Posts
    Global Posts
    446 Global Posts

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quote Originally Posted by Ziptied View Post
    Hey, my wife is from Statesboro. I was just there a week ago.
    Really? Lived here most of my life. Small world
  24. #49  
    Ziptied's Avatar
    Your Resident Googler

    Posts
    536 Posts
    Global Posts
    768 Global Posts
    ROM
    Stock

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    Quote Originally Posted by jpricesd View Post
    Really? Lived here most of my life. Small world
    I find myself saying that more and more.....
    Google it.
  25. Thread Author  Thread Author    #50  

    Default Re: Python script to notify you the minute the Nexus 4 page goes on sale

    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.
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Technically isn't it incorrect to say you are hacking the GNex?
    By CarryMe in forum Verizon Galaxy Nexus Rooting, ROMs, and Hacks
    Replies: 10
    Last Post: 01-04-2012, 08: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, 07: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, 07: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, 09:07 PM
  5. Replies: 3
    Last Post: 01-29-2010, 04:55 PM

Posting Permissions