import sqlite3
import time
import ssl
import urllib.request, urllib.parse, urllib.error
from urllib.parse import urljoin
from urllib.parse import urlparse
import re
from datetime import datetime, timedelta
# Not all systems have this so conditionally define parser
try:
import dateutil.parser as parser
except:
pass
def parsemaildate(md) :
# See if we have dateutil
try:
pdate = parser.parse(tdate)
test_at = pdate.isoformat()
return test_at
except:
pass
# Non-dateutil version - we try our best
pieces = md.split()
notz = " ".join(pieces[:4]).strip()
# Try a bunch of format variations - strptime() is *lame*
dnotz = None
for form in [ '%d %b %Y %H:%M:%S', '%d %b %Y %H:%M:%S',
'%d %b %Y %H:%M', '%d %b %Y %H:%M', '%d %b %y %H:%M:%S',
'%d %b %y %H:%M:%S', '%d %b %y %H:%M', '%d %b %y %H:%M' ] :
try:
dnotz = datetime.strptime(notz, form)
break
except:
continue
if dnotz is None :
# print 'Bad Date:',md
return None
iso = dnotz.isoformat()
tz = "+0000"
try:
tz = pieces[4]
ival = int(tz) # Only want numeric timezone values
if tz == '-0000' : tz = '+0000'
tzh = tz[:3]
tzm = tz[3:]
tz = tzh+":"+tzm
except:
pass
return iso+tz
# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
conn = sqlite3.connect('content.sqlite')
cur = conn.cursor()
baseurl = "http://mbox.dr-chuck.net/sakai.devel/"
cur.execute('''CREATE TABLE IF NOT EXISTS Messages
(id INTEGER UNIQUE, email TEXT, sent_at TEXT,
subject TEXT, headers TEXT, body TEXT)''')
# Pick up where we left off
start = None
cur.execute('SELECT max(id) FROM Messages' )
try:
row = cur.fetchone()
if row is None :
start = 0
else:
start = row[0]
except:
start = 0
if start is None : start = 0
many = 0
count = 0
fail = 0
while True:
if ( many < 1 ) :
conn.commit()
sval = input('How many messages:')
if ( len(sval) < 1 ) : break
many = int(sval)
start = start + 1
cur.execute('SELECT id FROM Messages WHERE id=?', (start,) )
try:
row = cur.fetchone()
if row is not None : continue
except:
row = None
many = many - 1
url = baseurl + str(start) + '/' + str(start + 1)
text = "None"
try:
# Open with a timeout of 30 seconds
document = urllib.request.urlopen(url, None, 30, context=ctx)
text = document.read().decode()
if document.getcode() != 200 :
print("Error code=",document.getcode(), url)
break
except KeyboardInterrupt:
print('')
print('Program interrupted by user...')
break
except Exception as e:
print("Unable to retrieve or parse page",url)
print("Error",e)
fail = fail + 1
if fail > 5 : break
continue
print(url,len(text))
count = count + 1
if not text.startswith("From "):
print(text)
print("Did not find From ")
fail = fail + 1
if fail > 5 : break
continue
pos = text.find("\n\n")
if pos > 0 :
hdr = text[:pos]
body = text[pos+2:]
else:
print(text)
print("Could not find break between headers and body")
fail = fail + 1
if fail > 5 : break
continue
email = None
x = re.findall('\nFrom: .* <(\S+@\S+)>\n', hdr)
if len(x) == 1 :
email = x[0];
email = email.strip().lower()
email = email.replace("<","")
else:
x = re.findall('\nFrom: (\S+@\S+)\n', hdr)
if len(x) == 1 :
email = x[0];
email = email.strip().lower()
email = email.replace("<","")
date = None
y = re.findall('\Date: .*, (.*)\n', hdr)
if len(y) == 1 :
tdate = y[0]
tdate = tdate[:26]
try:
sent_at = parsemaildate(tdate)
except:
print(text)
print("Parse fail",tdate)
fail = fail + 1
if fail > 5 : break
continue
subject = None
z = re.findall('\Subject: (.*)\n', hdr)
if len(z) == 1 : subject = z[0].strip().lower();
# Reset the fail counter
fail = 0
print(" ",email,sent_at,subject)
cur.execute('''INSERT OR IGNORE INTO Messages (id, email, sent_at, subject, headers, body)
VALUES ( ?, ?, ?, ?, ?, ? )''', ( start, email, sent_at, subject, hdr, body))
if count % 50 == 0 : conn.commit()
if count % 100 == 0 : time.sleep(1)
conn.commit()
cur.close()
"But I have only one disguise in the house--the old one." "How much is it, madame?" "9. Van Hoeyaerden, member of the Town Council. 121 Previous to his forty-ninth year, Plotinus wrote nothing. At that age he began to compose short essays on subjects which suggested themselves in the course of his oral teaching. During the next ten years, he produced twenty-one such278 papers, some of them only a page or two in length. At the end of that period, he made the acquaintance of his future editor and biographer, Porphyry, a young student of Semitic extraction, whose original name was Malchus. The two soon became fast friends; and whatever speculative differences at first divided them were quickly removed by an amicable controversy between Porphyry and another disciple named Amelius, which resulted in the unreserved adhesion of the former to the doctrine of their common master.415 The literary activity of Plotinus seems to have been powerfully stimulated by association with the more methodical mind of Porphyry. During the five years416 of their personal intercourse he produced nineteen essays, amounting altogether to three times the bulk of the former series. Eight shorter pieces followed during the period of failing health which preceded his death, Porphyry being at that time absent in Sicily, whither he had retired when suffering from the fit of depression already mentioned. He did not answer at once, but sat watching the trumpeter come out of the adjutant's office to sound recall. "Yes, she will marry," he agreed; "if no one else marries her, I will. I am as old as her father would have been but it would save telling some fellow about her birth." "You must get Mrs. Landor into the post to-morrow," Cairness said abruptly; "Victorio's band is about." The next day he left for the Circle K Ranch. Lawton did not appear to need help. But he fired a Greaser, nevertheless, and took Cairness on. He seemed to stand in as abject awe of Stone's note as an Arab might have stood of a bit of the black covering of the Kaabah stone. On the 9th of January, a month after their arrival, Lord Derwentwater was impeached of high treason by Mr. Lechmere in a bitter speech in the Commons. Other members, with equal acrimony, followed with impeachments against the Lords Widdrington, Nithsdale, Wintoun, Carnwath, Kenmure, and Nairn. The impeachments were carried up to the House of Lords on the same day, and on the 19th the accused noblemen were brought before the Peers, where they knelt at the bar until they were desired to rise by the Lord Chancellor, when, with the exception of Lord Wintoun, they confessed their guilt, and threw themselves on the mercy of the king. Sentence of death was immediately pronounced on those who had pleaded guilty; and Lord Wintoun was condemned after trial, but several months later he effected his escape from the Tower. Every effort was made to save the prisoners, and they were all reprieved, with the exception of Derwentwater, Kenmure, and Nithsdale. The first two were executed; but the Countess of Nithsdale, being about to take her leave of her husband, contrived, by introducing some friends, to secure his escape in female attire. Q, 200th Ind. Rush. Yours, Jim." "Reckon I can," said Albert good-naturedly, knowing that some day he might want his brother to do the same for him. "Lie there, dog!—there goes one of the accursed council!" and, springing up the step with a giant grasp, he seized the mitred chancellor by the neck, and dragged him forth into the centre of the church. HoME有没有泷泽萝拉的呀
ENTER NUMBET 0016www.fg500.com.cn
www.hnjnsbm.org.cn
www.lixinvip.com.cn
guituapp.com.cn
www.lnjyzyq.org.cn
www.jcchain.com.cn
hbyttsc.com.cn
smwallet.com.cn
www.sptqyh.com.cn
www.txyu.com.cn