十一 03

但愿不用等太晚:)

#!/usr/bin/python
 
import urllib2
import sys
import time
 
def alarm():
	while True:
		sys.stdout.write('\a')
		sys.stdout.flush()
 
def poll():
	count=0;
	while True:
		count = count + 1
		now = time.localtime( time.time() )
		print '%02d:%02d:%02d %d' % (now.tm_hour, now.tm_min, now.tm_sec, count)
		try:
			urllib2.urlopen('http://store.apple.com/hk-zh/browse/home/shop_iphone/family/iphone/iphone4s')
			alarm()
		except urllib2.HTTPError as error:
			pass
			#print error
 
		try:
			iphone4 = urllib2.urlopen( 'http://store.apple.com/hk-zh/browse/home/shop_iphone/family/iphone/iphone4' )
			html = ''.join( iphone4.readlines() )
			if html.find( 'iPhone 4S' ) != -1 :
				alarm()
		except:
			pass
 
		#time.sleep(1)
 
if __name__ == '__main__':
	poll()

3 Responses to “监控iPhone 4S发布的Python脚本”

  1. 口气重怎么办 说道:

    文章写得不错,蛮有见地的。学习了。。

  2. ck男士香水 说道:

    6uk6qg明天你还会更新的吧 明天我在来

  3. 添香防辐射服 说道:

    5hx5dt明天你还会更新的吧 明天我在来

Leave a Reply

preload preload preload

无觅相关文章插件,快速提升流量