Differences between revisions 8 and 9
Revision 8 as of 2006-02-17 09:16:30
Size: 3969
Editor: andelf
Comment:
Revision 9 as of 2006-07-07 16:09:38
Size: 2266
Editor: andelf
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
此页保留~哈哈~ == 关于自己 ==
Line 6: Line 6:
BLOG: http://blog.sohu.com/members/andelf/
Line 10: Line 8:
BLOG: http://spaces.msn.com/andelf BLOG: http://andelf.spaces.msn.com
Line 12: Line 10:
== 陕西广电登陆程序(供Linux,FreeBSD使用) ==

现在有个情况就是不知道 'l_PwPUE~IBo<' 'k@?6SYhabQA4' 是如何加密的,如果有谁能帮下忙....不胜感激.
yula00499 => 'l_PwPUE~IBo<'
Line 58: Line 60:
            print "You've Disconnected from the Server!!"              print "You've Disconnected from the Server!!"
Line 65: Line 67:
{{{#!python
from urllib import urlopen
from datetime import datetime,timedelta
# a possible url:http://antwrp.gsfc.nasa.gov/apod/ap050825.html
urlprefix = """http://antwrp.gsfc.nasa.gov/apod/"""

# key code:
#"""<a href="image/0508/MWart_spitzer_f50.jpg"> ---full pic
#<IMG SRC="image/0508/MWart_spitzer_c42.jpg" ---mini pic
#alt="See Explanation. Clicking on the picture will download
#the highest resolution version available."></a>"""



def mini(code):
    reswrtm.append(urlprefix+code[10:][:-1]+'\n')

def full(code):
    reswrtf.append(urlprefix+code[9:][:-2]+'\n')

def getcode(url):
    try:
        f = urlopen(url).readlines()
        for i in f:
            if i.startswith('<a href="image'):
                a = i
            elif i.startswith('<IMG SRC="image/0'):
                b = i
        return (a.replace('\n',''),b.replace('\n',''))
    except:
        raise SystemExit

def makeurl(day):
    start = datetime.now()
    a = []
    b = 1
    #while b== day:
    # a.append(urlprefix + 'ap' + \
    # str(start - timedelta(b))[2:10].replace('-','') + \
    # '.html')
    a = [urlprefix + 'ap' + str(start -\
                                timedelta(i+1)\
                                )[2:10].replace('-','') +'.html'
         for i in range(day)]
    return a
reswrtm = []
reswrtf = []
if __name__== '__main__':
    day = int(raw_input('How many days before?(numbers)'))
    urllist = makeurl(day)[:]
    for i in urllist:
        a,b = getcode(i)
        full(a)
        mini(b)
    resfile = file('full.txt','w')
    resfile.writelines(reswrtf)
    resfile.close()
    resfile = file('mini.txt','w')
    resfile.writelines(reswrtm)
    resfile.close()
    print """All pic's urls have been created!!
    You can find them in the file mini.txt & full.txt!!"""
    raw_input('Press Enter to exit!\n>>')
}}}
== 最近正在 ==
=== 学习TurboGears,准备做个BLOG ===

我就是那个很不起眼的Feather

关于自己

Mail: [email protected]

BLOG: http://blog.sina.com.cn/u/1145264221

BLOG: http://andelf.spaces.msn.com


陕西广电登陆程序(供Linux,FreeBSD使用)

现在有个情况就是不知道 'l_PwPUE~IBo<' 'k@?6SYhabQA4' 是如何加密的,如果有谁能帮下忙....不胜感激. yula00499 => 'l_PwPUE~IBo<'

   1 from urllib import thishost,urlopen
   2 from time import time
   3 myip = thishost()
   4 myname = 'l_PwPUE~IBo<'
   5 mypass = 'k@?6SYhabQA4'
   6 def login(ip,username,password):
   7     logurl = r'http://172.31.1.21/ClientProcess.jsp?MsgType=0&LocalIP='+\
   8              ip+r'&username='+username+r'&password='+password
   9     f = urlopen(logurl).read()
  10     for i in f.split('&'):
  11         if i.startswith('loginKey'):
  12             a = i.replace('loginKey=','')
  13         elif i.startswith('username='):
  14             b = i.replace('username=','')
  15     if a and b:
  16         return (a, b)
  17     else: raise RuntimeError
  18 def logout(ip,cname,logkey):
  19     outurl = r'http://172.31.1.21/ClientProcess.jsp?MsgType=3&ISNNO=1021&LocalIP='+\
  20               ip+r'&UserName='+cname+r'&LoginKey='+logkey+'&isPNP=0&httpIP='+ip
  21     f = urlopen(outurl).read()
  22     if f.find('ipconfig=0')!= -1:
  23         return True
  24     else: return False
  25 print '*********Network Client For SXBCTV*********'
  26 print 'Program By Feather ([email protected])'
  27 print 'Now login to the server....'
  28 try:
  29     p = login(myip, myname, mypass)
  30 except:
  31     print 'Login Error, Check Connection Please!'
  32 if p:
  33     start = time()
  34     key = p[0]
  35     cname = p[1]
  36     print 'You are Login As %s ,The Key is %s' % (cname, key)
  37 else :
  38     print 'Login Error, Check Connection Please!'
  39 while True:
  40     cmd = raw_input("Type 'exit' While You Want To Disconnect: \n>>>")
  41     if cmd in ['exit', 'bye', 'quit', 'logoff', 'disconnect']:
  42         if logout(myip, cname, key):
  43             end = time()
  44             print 'Time Lasted(s):', end-start
  45             print "You've Disconnected from the Server!!"
  46             raise SystemExit
  47         else:
  48             print 'Error occured......'
  49             raise SystemExit


最近正在

学习TurboGears,准备做个BLOG

["个人网页类"]

Feather (last edited 2009-12-25 07:09:48 by localhost)