c**n 发帖数: 312 | 1 python code (不让attach code):
import urllib2
import re
import sys
prefix = sys.argv[1]
start = int(sys.argv[2])
end = int(sys.argv[3])
typeP = re.compile('Your Current Case Status for Form (\w+)')
statusP = re.compile('Your Case Status: ([\w\s/]*?)')
dateP = re.compile('(January|February|March|April|May|June|July|August|
September|Octobert|November|December) \d{1,2}, \d{4}')
for i in range(start, end):
caseId = prefix + str(i).zfill(10)
req = urllib2.Request("https://egov.uscis.gov/cris/Dashboard/CaseStatus.
do?appReceiptNum=" + caseId)
response = urllib2.urlopen(req)
html = response.read()
type = typeP.search(html)
status = statusP.search(html);
date = dateP.search(html);
dateStr = date and date.group() or "Unknown date"
if type and status:
print '%13s %8s %s Updated on %s' % (caseId, type.group(1),
status.group(1).strip(), dateStr)
else:
print '%13s not found.' % caseId
run like 'python read.py SRC 1290042200 1290042601 | grep i485'
哈哈。如果你不懂,就不要问我了。 | c**n 发帖数: 312 | 2 Sample results.
SRC1290042201 I485 Card/ Document Production Updated on March 15,
2012
SRC1290042206 I485 Card/ Document Production Updated on March 20,
2012
SRC1290042209 I485 Initial Review Updated on November 9, 2011
SRC1290042213 I485 Initial Review Updated on November 9, 2011
SRC1290042216 I485 Initial Review Updated on November 9, 2011
SRC1290042218 I485 Initial Review Updated on November 9, 2011
SRC1290042222 I485 Initial Review Updated on November 9, 2011
SRC1290042225 I485 Initial Review Updated on November 9, 2011
SRC1290042228 I485 Initial Review Updated on November 9, 2011
SRC1290042231 I485 Initial Review Updated on November 9, 2011
SRC1290042239 I485 Request for Evidence Response Review Updated
on February 28, 2012
SRC1290042242 I485 Initial Review Updated on November 10, 2011
SRC1290042250 I485 Initial Review Updated on January 6, 2012
SRC1290042264 I485 Card/ Document Production Updated on March 19,
2012
SRC1290042267 I485 Card/ Document Production Updated on March 19,
2012
SRC1290042270 I485 Card/ Document Production Updated on March 19,
2012
SRC1290042272 I485 Initial Review Updated on November 4, 2011
SRC1290042275 I485 Initial Review Updated on November 4, 2011
SRC1290042278 I485 Card/ Document Production Updated on February
3, 2012
SRC1290042281 I485 Card/ Document Production Updated on February
3, 2012
SRC1290042287 I485 Card/ Document Production Updated on February
24, 2012
SRC1290042291 I485 Card/ Document Production Updated on February
17, 2012
SRC1290042295 I485 Card/ Document Production Updated on December
1, 2011
SRC1290042299 I485 Card/ Document Production Updated on February
25, 2012
SRC1290042301 I485 Card/ Document Production Updated on February
27, 2012
SRC1290042302 I485 Card/ Document Production Updated on February
25, 2012
SRC1290042304 I485 Card/ Document Production Updated on February
25, 2012
SRC1290042306 I485 Initial Review Updated on November 9, 2011
SRC1290042308 I485 Initial Review Updated on November 9, 2011
SRC1290042311 I485 Initial Review Updated on November 9, 2011
SRC1290042314 I485 Card/ Document Production Updated on February
2, 2012
SRC1290042317 I485 Card/ Document Production Updated on February
3, 2012
SRC1290042320 I485 Card/ Document Production Updated on February
3, 2012
SRC1290042323 I485 Card/ Document Production Updated on March 1,
2012
SRC1290042326 I485 Card/ Document Production Updated on March 1,
2012
SRC1290042332 I485 Card/ Document Production Updated on March 2,
2012
SRC1290042333 I485 Card/ Document Production Updated on February
17, 2012
SRC1290042334 I485 Card/ Document Production Updated on February
17, 2012
SRC1290042337 I485 Card/ Document Production Updated on February
17, 2012
SRC1290042338 I485 Card/ Document Production Updated on February
17, 2012
SRC1290042339 I485 Card/ Document Production Updated on February
16, 2012
SRC1290042342 I485 Card/ Document Production Updated on February
16, 2012
SRC1290042346 I485 Card/ Document Production Updated on February
23, 2012
SRC1290042349 I485 Card/ Document Production Updated on February
21, 2012
SRC1290042352 I485 Card/ Document Production Updated on February
21, 2012
SRC1290042355 I485 Card/ Document Production Updated on February
17, 2012
SRC1290042356 I485 Card/ Document Production Updated on March 7,
2012
SRC1290042357 I485 Card/ Document Production Updated on March 15,
2012
SRC1290042358 I485 Card/ Document Production Updated on February
27, 2012
SRC1290042359 I485 Initial Review Updated on November 10, 2011
SRC1290042362 I485 Initial Review Updated on November 10, 2011
SRC1290042365 I485 Card/ Document Production Updated on March 19,
2012
SRC1290042368 I485 Card/ Document Production Updated on March 19,
2012
SRC1290042371 I485 Card/ Document Production Updated on February
25, 2012
SRC1290042374 I485 Card/ Document Production Updated on February
25, 2012
SRC1290042377 I485 Card/ Document Production Updated on February
25, 2012
SRC1290042380 I485 Card/ Document Production Updated on March 21,
2012
SRC1290042381 I485 Card/ Document Production Updated on March 21,
2012
SRC1290042383 I485 Initial Review Updated on November 10, 2011
SRC1290042386 I485 Initial Review Updated on November 10, 2011
SRC1290042389 I485 Card/ Document Production Updated on February
15, 2012
SRC1290042392 I485 Card/ Document Production Updated on February
15, 2012
SRC1290042395 I485 Initial Review Updated on November 10, 2011
SRC1290042398 I485 Initial Review Updated on November 10, 2011
SRC1290042401 I485 Request for Evidence Response Review Updated
on February 24, 2012
SRC1290042404 I485 Initial Review Updated on November 10, 2011
SRC1290042407 I485 Initial Review Updated on November 10, 2011
SRC1290042410 I485 Initial Review Updated on November 10, 2011
SRC1290042412 I485 Initial Review Updated on November 10, 2011
SRC1290042414 I485 Initial Review Updated on November 10, 2011
SRC1290042416 I485 Card/ Document Production Updated on February
17, 2012
SRC1290042419 I485 Card/ Document Production Updated on February
17, 2012
SRC1290042422 I485 Initial Review Updated on November 10, 2011
SRC1290042425 I485 Initial Review Updated on November 10, 2011
SRC1290042427 I485 Request for Evidence Response Review Updated
on March 9, 2012
SRC1290042430 I485 Request for Evidence Response Review Updated
on March 9, 2012
SRC1290042433 I485 Initial Review Updated on November 10, 2011
SRC1290042435 I485 Initial Review Updated on November 10, 2011
SRC1290042437 I485 Initial Review Updated on November 10, 2011
SRC1290042440 I485 Initial Review Updated on November 10, 2011
SRC1290042443 I485 Initial Review Updated on November 10, 2011
SRC1290042446 I485 Initial Review Updated on November 10, 2011
SRC1290042449 I485 Card/ Document Production Updated on February
17, 2012
SRC1290042452 I485 Card/ Document Production Updated on February
16, 2012
SRC1290042455 I485 Initial Review Updated on November 10, 2011
SRC1290042459 I485 Card/ Document Production Updated on February
11, 2012
SRC1290042462 I485 Card/ Document Production Updated on February
10, 2012
SRC1290042464 I485 Initial Review Updated on November 9, 2011
SRC1290042468 I485 Initial Review Updated on November 9, 2011
SRC1290042472 I485 Initial Review Updated on November 10, 2011
SRC1290042475 I485 Initial Review Updated on November 10, 2011
SRC1290042478 I485 Initial Review Updated on November 10, 2011
SRC1290042481 I485 Initial Review Updated on November 10, 2011
SRC1290042485 I485 Initial Review Updated on November 10, 2011
SRC1290042489 I485 Initial Review Updated on November 10, 2011
SRC1290042493 I485 Card/ Document Production Updated on February
21, 2012
SRC1290042496 I485 Initial Review Updated on February 23, 2012
SRC1290042497 I485 Initial Review Updated on February 23, 2012
SRC1290042498 I485 Card/ Document Production Updated on February
25, 2012
SRC1290042501 I485 Initial Review Updated on November 4, 2011
SRC1290042504 I485 Request for Evidence Updated on March 2, 2012
SRC1290042507 I485 Card/ Document Production Updated on February
15, 2012
SRC1290042510 I485 Card/ Document Production Updated on February
15, 2012
SRC1290042512 I485 Card/ Document Production Updated on February
15, 2012
SRC1290042515 I485 Card/ Document Production Updated on February
15, 2012
SRC1290042517 I485 Card/ Document Production Updated on March 21,
2012
SRC1290042520 I485 Card/ Document Production Updated on March 21,
2012
SRC1290042523 I485 Request for Evidence Response Review Updated
on February 28, 2012
SRC1290042526 I485 Request for Evidence Response Review Updated
on February 28, 2012
SRC1290042530 I485 Initial Review Updated on November 10, 2011
SRC1290042534 I485 Card/ Document Production Updated on March 14,
2012
SRC1290042537 I485 Initial Review Updated on November 10, 2011
SRC1290042541 I485 Initial Review Updated on November 10, 2011
SRC1290042545 I485 Card/ Document Production Updated on February
18, 2012
SRC1290042549 I485 Initial Review Updated on November 10, 2011
SRC1290042552 I485 Initial Review Updated on November 10, 2011
SRC1290042556 I485 Initial Review Updated on November 10, 2011
SRC1290042559 I485 Initial Review Updated on November 10, 2011
SRC1290042561 I485 Request for Evidence Updated on March 10, 2012
SRC1290042563 I485 Request for Evidence Updated on March 10, 2012
SRC1290042565 I485 Initial Review Updated on November 7, 2011 | c**n 发帖数: 312 | | a***a 发帖数: 4195 | 4 顶一下。USCIS 服务器表示压力很大。
python 的 regex 用起来 似乎没 perl 的方便简洁嘛。
【在 c**n 的大作中提到】![](/moin_static193/solenoid/img/up.png) : python code (不让attach code): : import urllib2 : import re : import sys : prefix = sys.argv[1] : start = int(sys.argv[2]) : end = int(sys.argv[3]) : typeP = re.compile('Your Current Case Status for Form (\w+)') : statusP = re.compile('Your Case Status: ([\w\s/]*?)') : dateP = re.compile('(January|February|March|April|May|June|July|August|
| c**n 发帖数: 312 | 5 嗯。计划每天扫它一下2下的。
【在 a***a 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 顶一下。USCIS 服务器表示压力很大。 : python 的 regex 用起来 似乎没 perl 的方便简洁嘛。
| h***t 发帖数: 96 | | s**3 发帖数: 191 | 7 Good.
But it doesn't work for me. I have to run two steps:
>read.py SRC 1290042200 1290042601 > status.txt
>cat status| grep I485 | s**3 发帖数: 191 | 8 My mistake. It works perfect. | j******l 发帖数: 10445 | 9 会不会被认为是黑客攻击他们的服务器?
我以前有个同事在公司运行类似的程序到美国某个政府网站,结果对方服务器瘫痪,被查出来
(同事不在美国),同事被公司开除。 | c**n 发帖数: 312 | 10 在家run呀。我只看前后300的。大约120个485。 |
|