Python 提取LinkedIn用户的人脉

CODE:

#!/usr/bin/python
# -*- coding: utf-8 -*-

'''
Created on 2014-8-18
@author: guaguastd
@name: linkedin_connection_retrieve.py
'''

# import login
from login import linkedin_login

# import json
import json
from prettytable import PrettyTable

# access to linkedin api
linkedin_api = linkedin_login()

connections = linkedin_api.get_connections()
connections_data = r'E:\eclipse\LinkedIn\dfile\linkedin_connections.json'

# Write connections into disk file
f = open(connections_data, 'w')
f.write(json.dumps(connections, indent=1))
f.close()

# Read data from disk file
connections = json.loads(open(connections_data).read())

# Print the connections
#print json.dumps(connections, indent=1)
pt = PrettyTable(field_names=['Name', 'Location'])
pt.align = 'l'

[pt.add_row((c['firstName'] + ' ' + c['lastName'], c['location']['name']))
 for c in connections['values']
     if c.has_key('location')]

print pt

RESULT:

+-------------------------+----------------------------+
| Name                    | Location                   |
+-------------------------+----------------------------+
| 飞 黄                   | Beijing City, China        |
| James Liao              | San Francisco Bay Area     |
| Gerald Soparkar         | San Francisco Bay Area     |
| Dimitrios Kouzis-Loukas | Birmingham, United Kingdom |
| Xiaodong Xu             | Beijing City, China        |
| Xinsong Li              | China                      |
| 科技 后院               | Chengdu, Sichuan, China    |
| 彦超 胡                 | Xingtai, Hebei, China      |
| 诺克 埃                 | Beijing City, China        |
| Zhang Jason             | Beijing City, China        |
| qu Sisyphus             | United States              |
| 洪林 张                 | Foshan, Guangdong, China   |
| beyond Bzhou            | United States              |
+-------------------------+----------------------------+

Python 提取LinkedIn用户的人脉

时间: 2024-10-06 03:02:05

Python 提取LinkedIn用户的人脉的相关文章

Python 对LinkedIn用户联系人的地址进行地理编码

CODE: #!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on 2014-8-20 @author: guaguastd @name: geocode_connection_bing.py ''' from geopy import geocoders import json GEO_APP_KEY = '' g = geocoders.Bing(GEO_APP_KEY) # access to linkedin api from l

Python 规范化LinkedIn用户联系人的职位名

CODE: #!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on 2014-8-19 @author: guaguastd @name: job_title_standard.py ''' import os import csv from collections import Counter from operator import itemgetter from prettytable import PrettyTable # sp

Python 规范化LinkedIn用户的联系人所在公司后缀 (data normalization)

CODE: #!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on 2014-8-19 @author: guaguastd @name: company_suffix_normalize.py ''' # import json import os import csv from collections import Counter from operator import itemgetter from prettytable imp

Python 显示LinkedIn用户的工作岗位

CODE: #!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on 2014-8-18 @author: guaguastd @name: job_position_display.py ''' # import login from login import linkedin_login # import json import json # access to linkedin api linkedin_api = linkedin_

Python 提取Twitter用户的Tweet

CODE: #!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on 2014-7-31 @author: guaguastd @name: harvest_user_tweet.py ''' if __name__ == '__main__': # import json import json # import search from search import search_for_tweet # import harvest_use

Python 聚类分析LinkedIn用户人脉网络

CODE: #!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on 2014-8-26 @author: guaguastd @name: linkedin_network_clusters.py ''' import os import sys import json from urllib2 import HTTPError from cluster import KMeansClustering, centroid # A help

Python 提取Twitter特定话题中转载tweet的用户

CODE: #!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on 2014-7-7 @author: guaguastd @name: user_retweet_statuses.py ''' if __name__ == '__main__': # import login, see http://blog.csdn.net/guaguastd/article/details/31706155 from login import tw

移动互联网:社交的发展,人脉的扩展

随着移动互联网的发展,已经受到了越来越多的企业的高度重视.从移动互联网覆盖面的不断扩大.网速的提高及智能终端的不断配合发展,都创造了极大的发展空间. 在移动互联网开头,以SNS.微博及LBS等各式各样为代表的社交网络应用,为整个人类的交流沟通带来了深刻的变化,人们的交往更加便利,信息的传播更加迅速,这一切也为企业营销创造了极为有利的条件. 针对智能手机用户的研究发现,74%的人使用他们的智能手机访问社交网络,42%的人每天都会使用社交网络.根据无线互联网数据和移动数据采集合作伙伴,社交网络是首要

商务社交的拓展人脉的基础

随着商务社交网站的发展和推广,加入商务社交网站的人群也越来越多,从刚开始的尝试使用到后来的习惯动作,商务社交网已经慢慢成为生活中不可缺少的一个部分了.这时候需要有一个安全的商务社交平台,网信平台正好给这部分商务人士提供了个这样绿色安全的商务社交平台.真实的姓名注册.真实的信息发布.真诚的商务合作.严格的审核制度保护了用户的信息安全. 用户以社会真实身份在上面进行交流.主要包括三个方面的内容,人脉巩固拓展.招聘和商务合作.让用户可以通过好友邀请将自己的同事朋友聚集到平台上来,集结成交友圈.能够即时