pythonʵÏÖtwitter client
¹«Ë¾µÄ´úÀí¿ÉÒÔÖ±½Ó´©Ç½£¬×ÔÓÉ·ÃÎÊTwitter¡¢FacebookµÈÍøÕ¾£¬ÕâÁ½ÌìÑо¿ÁËÒ»ÏÂTwitterÌṩµÄAPI£¬ÓÃpythonдÁËÒ»¸ötwitter client£¬Ö»ÊµÏÖÁË»ù±¾¹¦ÄÜ£¬²é¿´×Ô¼ºµÄtwitterÏûÏ¢£¬Ò²¿ÉÒÔ²»ÑéÖ¤£¬²é¿´publicµÄtwitterÏûÏ¢¡£ÆäËû¹¦ÄÜʵÏÖÀàËÆ¡£Ö÷Òªº¯ÊýÈçÏ£º
def fetch_with_proxy(proxy, username, password, url):
proxy_handler = urllib2.ProxyHandler({"http" : proxy})
opener = urllib2.build_opener(proxy_handler)
urllib2.install_opener(opener)
authheader = AddAuthorizationHeader(username, password)
req = urllib2.Request(url)
try:
res = urllib2.urlopen(req)
except IOError, e:
if hasattr(e, 'code'):
if e.code != 401:
print e.code
else:
req.add_header("Authorization", authheader)
res = urllib2.urlopen(req)
data= simplejson.loads(res.read())
def AddAuthorizationHeader(username, password):
if username and password:
basic_auth = base64.encodestring('%s:%s' % (username, password))[:-1]
return 'Basic %s' % basic_auth
def main(user):
username='XXX@gmail.com' #change to your username and password
password='XXX'
proxy='host:port' &
Ïà¹ØÎĵµ£º
PythonÖÐ×Ö·û´®±»¶¨ÒåΪÒýºÅÖ®¼äµÄ×Ö·û¼¯ºÏ¡£PythonÖ§³ÖʹÓóɶԵĵ¥ÒýºÅ»òË«ÒýºÅ£¬ÈýÒýºÅ°üº¬µÄ×Ö·û´®¡£
ʹÓÃË÷Òý²Ù×÷·û([])ºÍÇÐƬ²Ù×÷·û([:])¿ÉÒԵõ½×Ó×Ö·û´®¡£×Ö·û´®ÓÐÆäÌØÓеÄË÷Òý¹æÔò£ºµÚÒ»¸ö×Ö·ûµÄË÷ÒýÊÇ£°
£¬×îºóÒ»¸ö×Ö·ûµÄË÷ÒýÊÇ-1¡£
¼ÓºÅ(+)ÓÃÓÚ×Ö·û´®Á¬½ÓÔËË㣬ÐǺÅ(*)ÔòÓÃÓÚ×Ö·û´®Öظ´¡£ÈçÏÂÀý£º
pystr = " ......
ת×Ô http://www.javaeye.com/topic/66558
³õѧPython,Óöµ½ºÜ¶à±àÂëÎÊÌ⣬¼ÇÏÂÀ´ÒÔÃ⽫À´ÓÖÍüÁË£¬ºÜ¶à¶«Î÷²»¶®£¬¶¼ÊÇÊôÓÚ²»ÇóÉõ½â£¬ÂÒϽáÂÛ£¬µ«Ïëµ½ÄóöÀ´¿ÉÒÔÓÐÈÈÐÄͬѧָ³ö´íÎóËùÔÚ£¬±ãºñÆðÁ³Æ¤ÁË……
Ê×ÏÈÐèÒªÁ˽âPythonÖÐÓÐÁ½ÖÖ×Ö·û´®(ÑϸñµØ˵,Ëƺõ²»ÄÜÕâô½Ð)¡£Ò»ÖÖÊÇÆÕͨµÄstr¶ÔÏó£¨Ã¿¸ö×Ö·ûÓÃ8bits± ......
2007-08-22 22:46
Ò»¡¢ÓÃSOAPpy·ÃÎÊdotnet webservice
dotnetµÄwebservice
<WebMethod()> _
Public Function HelloWorld() As String
Return "H ......
twistedÊÇÒ»¸öרÃÅÓÃÓÚpythonµÄÍøÂ翪·¢µÄ¿ò¼Ü¡£¿ÉÒÔ˵ÊÇÏÖÔÚpythonÖÐеÄÒ»Ö§ÖÁÁ¦ÓÚ·¢Õ¹¸ßÐÔÄÜÍøÂ翪·¢µÄ¿ò¼Ü£¬·¢Õ¹ºÜÎȶ¨¡£
http://twistedmatrix.com/trac/
http://www-128.ibm.com/developerworks/cn/linux/network/l-twist/part1/index.html
http://wiki.woodpecker.org.cn/moin/PyTwisted ......