半肾
精华
|
战斗力 鹅
|
回帖 0
注册时间 2002-7-8
|
楼主 |
发表于 2012-1-7 15:53
|
显示全部楼层
我随便贴了点而已难道要我贴全?
cpu我就没见过坏的,还保修盒装捏,要来干嘛?...
760 900随便收了还上下,真当这U保值啊,q96还卖1k3捏你和775比....,要我贴别人700和750的760出来么.....
性能是没淘汰,但是给inter给卖了....
-v-昨天有人卖2400的三星条子,发帖的时候看见了没反应过来几个小时就全没了orz
脚本差不多了...麻痹没事刷住,嘿嘿
import struct,re,sys,urllib2,urllib,time
import threading
import daemon
p = daemon.DaemonContext()
p.open()
def getUrl(condition,bbs_url,lock=0):
k = 0
while k == 0:
try:
respone = urllib2.urlopen(bbs_url)
charset = respone.headers.getparam('charset')
if charset is None:
charset = "GBK"
Html_text = respone.read().decode(charset)
respone.close()
except:
print "error"
i = 0
lines = Html_text.split('\\n')
for line in lines:
if condition['re_CupAndP55'].search(line) or ( not condition['re_Video_No'].search(line) and condition['re_Video_Yes'].search(line) and condition['re_Video'].search(line)):
print line
link = re.compile('.*<a\\shref=\\"([^\\']*\\.html)').findall(line)
if len(link) == 0:
true_link = re.compile('\\/.*[0-9]').findall(lines[i-1])
if len(true_link)>0:
lock.acquire()
try:
f = open('/root/2hand.txt','a+')
url_list = f.readlines()
if 'http://diybbs.zol.com.cn' + true_link[0] + '\\n' not in url_list:
f.writelines('http://diybbs.zol.com.cn%s\\n' % true_link[0])
f.close()
except:
f.close()
lock.release()
else:
lock.acquire()
try:
f = open('/root/2hand.txt','a+')
url_list = f.readlines()
if link[0] + '\\n' not in url_list:
f.writelines('%s\\n' % link[0])
f.close()
except:
print "error"
f.close()
lock.release()
i += 1
time.sleep(90)
class myGet(object):
def __init__(self):
self.lock = threading.Lock()
self.url = {'gz':'http://we.pcinlife.com/forum-298-1.html','zol':'http://diybbs.zol.com.cn/subcate_list_300.html','chh':'http://www.chiphell.com/forum-26-1.html'}
self.condition = {'re_CupAndP55':re.compile(r'.*(?=i5 760|i5 750|i5750|i5760i|p7p55d).*/a>',re.I),\\
're_Video':re.compile(r'.*(?=5850|5870).*/a>',re.I),\\
're_Video_Yes':re.compile(u'公版',re.I),\\
're_Video_No':re.compile(u'非公版',re.I)}
def run(self):
for i in self.url.values():
postThread = threading.Thread(target=getUrl,args=(self.condition,i,self.lock))
postThread.start()
if __name__ == '__main__':
get = myGet()
get.run() |
|