17-04-2009, 23:49 | #571 |
The Stig
Join Date: Jun 2006
Location: Swad!
Posts: 10,713
|
Ok, Dee was playing 80's game, so happened to have laptop Only quick and dirty, so excuse the lack of comments.
Code:
#!/usr/bin/env python import urllib2, smtplib def mail(serverURL=None, sender='', to='', subject='', text=''): """ Usage: mail('somemailserver.com', 'me@example.com', 'someone@example.com', 'test', 'This is a test') """ headers = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (sender, to, subject) message = headers + text mailServer = smtplib.SMTP(serverURL) mailServer.sendmail(sender, to, message) mailServer.quit() baseurl = 'http://www.cokezone.co.uk/home/catalogue/reward/prod1020003/Xbox/200+Points+for+Xbox+Live' page = urllib2.urlopen(baseurl) source = page.read() if 'soldout' in source: print 'Still none...' else: mail('my.mail.server', 'me@me.com', ['me:me.com'], 'CokeZone MS Points', 'Cokezone has points, go go go!') print 'Found some! Emailed.'
__________________
apt-get moo |
18-04-2009, 00:17 | #572 |
I iz speshul
Join Date: Jun 2006
Location: Liverpool
Posts: 6,296
|
Clever! I understand the basics of the script but I could never write anything like that myself. I'll just rely on checking the page as often as I remember
__________________
Our deepest fear is not that we are inadequate. Our deepest fear is that we are powerful beyond measure. It is our light, not our darkness, that most frightens us. Your playing small does not serve the world. There is nothing enlightened about shrinking so that other people won't feel insecure around you. We are all meant to shine as children do. It's not just in some of us; it is in everyone. And as we let our own lights shine, we unconsciously give other people permission to do the same. As we are liberated from our own fear, our presence automatically liberates others. |
18-04-2009, 01:06 | #573 |
Screaming Orgasm
Join Date: Jul 2006
Location: Newbury
Posts: 15,194
|
Real geeks don't need comments.
Until, that is, they get a few million lines of code dumped on them and told to maintain it, as has happened to the team I work with. Well, there are some comments, but they're in Russian. |
18-04-2009, 10:07 | #574 |
The Stig
Join Date: Jun 2006
Location: Swad!
Posts: 10,713
|
A client of ours were once upon a time trying to install a new erp system, but the database schema and accompanying docs were in German. Though I'll admit I know more of German than I do Russian
__________________
apt-get moo |
18-04-2009, 12:59 | #575 |
Do you want to hide in my box?
Join Date: Jun 2006
Posts: 14,941
|
http://softuk.com/Xbox_360_Product_V...D=36UK10112657
Burnout Paradise: Ultimate Box and Trivial Pursuit for £15.99. Seems a good deal to me
__________________
Halycopter |
18-04-2009, 22:11 | #576 |
Columbian Coffee
Join Date: Oct 2008
Posts: 90
|
Ooooh sounds like a bargain to me, cheers for the heads up.
|
20-04-2009, 09:10 | #577 | |
The Stig
Join Date: Jun 2006
Location: Swad!
Posts: 10,713
|
Looks like we're done with Coke Zone points this week:
Quote:
__________________
apt-get moo |
|
20-04-2009, 09:10 | #578 |
Chef extraordinaire
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
|
So none on Friday?
__________________
"Dr Sheldon Cooper FTW!" |
20-04-2009, 09:49 | #579 |
I iz speshul
Join Date: Jun 2006
Location: Liverpool
Posts: 6,296
|
They'll be back up this weekend I'm sure, just not sure when.
__________________
Our deepest fear is not that we are inadequate. Our deepest fear is that we are powerful beyond measure. It is our light, not our darkness, that most frightens us. Your playing small does not serve the world. There is nothing enlightened about shrinking so that other people won't feel insecure around you. We are all meant to shine as children do. It's not just in some of us; it is in everyone. And as we let our own lights shine, we unconsciously give other people permission to do the same. As we are liberated from our own fear, our presence automatically liberates others. |
20-04-2009, 09:54 | #580 |
Chef extraordinaire
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
|
ah right ok, well we'll all wait for Daz's post
__________________
"Dr Sheldon Cooper FTW!" |
Thread Tools | |
Display Modes | |
|
|