当前位置: 首页>>代码示例>>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;未经允许,请勿转载。