當前位置: 首頁>>代碼示例>>Python>>正文


Python FlickrAPI.people_getInfo方法代碼示例

本文整理匯總了Python中flickrapi.FlickrAPI.people_getInfo方法的典型用法代碼示例。如果您正苦於以下問題:Python FlickrAPI.people_getInfo方法的具體用法?Python FlickrAPI.people_getInfo怎麽用?Python FlickrAPI.people_getInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在flickrapi.FlickrAPI的用法示例。


在下文中一共展示了FlickrAPI.people_getInfo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: len

# 需要導入模塊: from flickrapi import FlickrAPI [as 別名]
# 或者: from flickrapi.FlickrAPI import people_getInfo [as 別名]
	# save the set for later
	neighbor_sets[contact_nsid] = friendcontactset
	neighbor_num_shared[contact_nsid] = len(sharedcontactset)
	neighbor_weighted[contact_nsid] = float(len(sharedcontactset)) / (len(mycontactset) + len(friendcontactset)) 
	print "%s\ttotal: %d shared: %d weighted: %f" % (contact_nsid, len(friendcontactlist), len(sharedcontactset), neighbor_weighted[contact_nsid] )

#nextdoor = sorted(neighbor_num_shared.items(), key=itemgetter(1), reverse=True)
nextdoor = sorted(neighbor_weighted.items(), key=itemgetter(1), reverse=True)
output = []
#(a,b,c) = ( sets.Set(), sets.Set(), sets.Set() )
a = mycontactset
b = neighbor_sets[ nextdoor[0][0] ]
c = neighbor_sets[ nextdoor[1][0] ]
user_a = user
#userb
rsp = fapi.people_getInfo(api_key=apikey_flickr,user_id=nextdoor[0][0])
fapi.testFailure(rsp)
user_b = rsp.person[0].username[0].elementText
#userc
rsp = fapi.people_getInfo(api_key=apikey_flickr,user_id=nextdoor[1][0])
fapi.testFailure(rsp)
user_c = rsp.person[0].username[0].elementText

# Supply one data set where:
#     * The first three values specify the relative sizes of three circles: A, B, and C.
chd = [ len(a), len(b), len(c) ] 
#     * The fourth value specifies the area of A intersecting B.
chd.append( len( a.intersection(b) ) ) 
#     * The fifth value specifies the area of A intersecting C.
chd.append( len ( a.intersection(c) ) )
#     * The sixth value specifies the area of B intersecting C.
開發者ID:CollabAcademy,項目名稱:flickr-socialvenn,代碼行數:33,代碼來源:flickrsocialvenn.py


注:本文中的flickrapi.FlickrAPI.people_getInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。