Boat Drinks  

Go Back   Boat Drinks > General > Computer and Consoles

Reply
 
Thread Tools Display Modes
Old 17-04-2009, 23:49   #571
Daz
The Stig
 
Daz's Avatar
 
Join Date: Jun 2006
Location: Swad!
Posts: 10,713
Default

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
Daz is offline   Reply With Quote
Old 18-04-2009, 00:17   #572
Davey_Pitch
I iz speshul
 
Davey_Pitch's Avatar
 
Join Date: Jun 2006
Location: Liverpool
Posts: 6,296
Default

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.
Davey_Pitch is offline   Reply With Quote
Old 18-04-2009, 01:06   #573
Mark
Screaming Orgasm
 
Join Date: Jul 2006
Location: Newbury
Posts: 15,194
Default

Quote:
Originally Posted by Daz View Post
Only quick and dirty, so excuse the lack of comments.
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.
Mark is offline   Reply With Quote
Old 18-04-2009, 10:07   #574
Daz
The Stig
 
Daz's Avatar
 
Join Date: Jun 2006
Location: Swad!
Posts: 10,713
Default

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
Daz is offline   Reply With Quote
Old 18-04-2009, 12:59   #575
Haly
Do you want to hide in my box?
 
Haly's Avatar
 
Join Date: Jun 2006
Posts: 14,941
Default

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
Haly is offline   Reply With Quote
Old 18-04-2009, 22:11   #576
SiD the Turtle
Columbian Coffee
 
SiD the Turtle's Avatar
 
Join Date: Oct 2008
Posts: 90
Default

Ooooh sounds like a bargain to me, cheers for the heads up.
__________________

SiDTheTurtle.co.uk - Updated 27/09
SiD the Turtle is offline   Reply With Quote
Old 20-04-2009, 09:10   #577
Daz
The Stig
 
Daz's Avatar
 
Join Date: Jun 2006
Location: Swad!
Posts: 10,713
Default

Looks like we're done with Coke Zone points this week:

Quote:
This reward is no longer available.
__________________
apt-get moo
Daz is offline   Reply With Quote
Old 20-04-2009, 09:10   #578
leowyatt
Chef extraordinaire
 
leowyatt's Avatar
 
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
Default

So none on Friday?
__________________
"Dr Sheldon Cooper FTW!"
leowyatt is offline   Reply With Quote
Old 20-04-2009, 09:49   #579
Davey_Pitch
I iz speshul
 
Davey_Pitch's Avatar
 
Join Date: Jun 2006
Location: Liverpool
Posts: 6,296
Default

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.
Davey_Pitch is offline   Reply With Quote
Old 20-04-2009, 09:54   #580
leowyatt
Chef extraordinaire
 
leowyatt's Avatar
 
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
Default

ah right ok, well we'll all wait for Daz's post
__________________
"Dr Sheldon Cooper FTW!"
leowyatt is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 17:23.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.