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_login()

# Load connections data from disk file
connections_data = r'E:\eclipse\LinkedIn\dfile\linkedin_connections.json'
connections = json.loads(open(connections_data).read())

# Display your own positions...
print '\rMy positions with all information:\r'
my_positions = linkedin_api.get_profile(selectors=['positions'])
print json.dumps(my_positions, indent=1)

# Display your own positions...
print '\rMy positions with only company information:\r'
my_positions = linkedin_api.get_profile(selectors=['positions:(company:(name,industry,id))'])
print json.dumps(my_positions, indent=1)

# Display positions for someone in your network...
connection_ids = [c['id']
                  for c in connections['values']
                      if c.has_key('location')]

for connection_id in connection_ids:
    print '\rPositions whose id is %s:\r' % connection_id
    connection_positions = linkedin_api.get_profile(member_id=connection_id, selectors=['positions'])
    print json.dumps(connection_positions, indent=1)

RESULT:

My positions with all information:
{
 "positions": {
  "_total": 1,
  "values": [
   {
    "startDate": {
     "year": 2009,
     "month": 12
    },
    "company": {
     "id": 1448618,
     "name": "Pica8 Inc."
    },
    "id": 509989134,
    "isCurrent": true,
    "title": "Data Mining, Analysis, Automation"
   }
  ]
 }
}

My positions with only company information:
{
 "positions": {
  "_total": 1,
  "values": [
   {
    "company": {
     "id": 1448618,
     "name": "Pica8 Inc."
    }
   }
  ]
 }
}

Positions whose id is pI4CXEK7gH:
{
 "positions": {
  "_total": 1,
  "values": [
   {
    "startDate": {
     "year": 2012,
     "month": 7
    },
    "title": "Senior Consultant",
    "company": {
     "id": 2868072,
     "name": "SoftTalent Consulting \u4e92\u8054\u7f51\u7cbe\u82f1\u8f6f\u4ef6\u5f00\u53d1\u4eba\u624d\u62db\u8058\u4e13\u5bb6"
    },
    "summary": "SoftTalent Consulting\u4e13\u6ce8\u5728\u8f6f\u4ef6\u4eba\u624d\u7684\u641c\u5bfb\u3002",
    "isCurrent": true,
    "id": 332578726
   }
  ]
 }
}

Positions whose id is Xd-Bk8g6tv:
{
 "positions": {
  "_total": 1,
  "values": [
   {
    "startDate": {
     "year": 2009,
     "month": 9
    },
    "title": "CEO & Founder",
    "company": {
     "id": 1448618,
     "name": "Pica8 Inc."
    },
    "summary": "Execution. Create an open network solution. Enable innovation in the datacenter network.",
    "isCurrent": true,
    "id": 262359413
   }
  ]
 }
}

Positions whose id is Iav6QYRTLk:
{
 "positions": {
  "_total": 0
 }
}

Positions whose id is VYzO1WXGPh:
{
 "positions": {
  "_total": 2,
  "values": [
   {
    "startDate": {
     "year": 2013,
     "month": 10
    },
    "title": "Senior Software Developer",
    "company": {
     "id": 2494,
     "name": "Bloomberg LP"
    },
    "summary": "Developing C++ high availability Bloomberg Terminal services responsible for delivering millions of real time financial data alerts per day.",
    "isCurrent": true,
    "id": 475536757
   },
   {
    "startDate": {
     "year": 2009,
     "month": 10
    },
    "title": "Sole Trader",
    "company": {
     "name": "Dimitrios Kouzis-Loukas"
    },
    "summary": "Developed software solutions in C/C++ and Java for market leading businesses in the fields of finance, hardware design, particle physics and GIS.",
    "isCurrent": true,
    "id": 122386746
   }
  ]
 }
}

Positions whose id is N_jQbpGMml:
{
 "positions": {
  "_total": 1,
  "values": [
   {
    "startDate": {
     "year": 2013,
     "month": 2
    },
    "title": "Software Manager",
    "company": {
     "id": 166878,
     "name": "WatchGuard Technologies"
    },
    "summary": "Networking development for XTM",
    "isCurrent": true,
    "id": 377469950
   }
  ]
 }
}

Positions whose id is wTro4h6_CK:
{
 "positions": {
  "_total": 1,
  "values": [
   {
    "startDate": {
     "year": 2014,
     "month": 4
    },
    "title": "Senior Software Engineer",
    "company": {
     "id": 1035,
     "name": "Microsoft"
    },
    "summary": "Recommender System development.",
    "isCurrent": true,
    "id": 536101418
   }
  ]
 }
}

Positions whose id is 5lVrRMvUEl:
{
 "positions": {
  "_total": 1,
  "values": [
   {
    "company": {
     "name": "\u6210\u90fd\u540e\u9662\u79d1\u6280\u6709\u9650\u516c\u53f8"
    },
    "id": 529513768,
    "isCurrent": true,
    "title": "\u521b\u529e\u4eba"
   }
  ]
 }
}

Positions whose id is llopT6R_sI:
{
 "positions": {
  "_total": 1,
  "values": [
   {
    "startDate": {
     "year": 2011
    },
    "title": "Online Marketing Manager",
    "company": {
     "name": "Hebei Meishen Chemical Group CO.,Ltd"
    },
    "summary": "Mainly focus on magnesium oxide market at home and abroad , as a network marketing manager, using professional SEO, bidding extension services, help the company achieved good sales performance.",
    "isCurrent": true,
    "id": 533005372
   }
  ]
 }
}

Positions whose id is PPzgxCdZFH:
{
 "positions": {
  "_total": 0
 }
}

Positions whose id is uFsj9caqQ_:
{
 "positions": {
  "_total": 1,
  "values": [
   {
    "startDate": {
     "year": 2007,
     "month": 10
    },
    "title": "Director",
    "company": {
     "name": "CET"
    },
    "summary": "DMS\u3001AMI\u3001HAN\u3001CIS\u3001IEC-61968/61970",
    "isCurrent": true,
    "id": 166639434
   }
  ]
 }
}

Positions whose id is 3mGHBgssI_:
{
 "positions": {
  "_total": 0
 }
}

Positions whose id is cQZpI8aFDI:
{
 "positions": {
  "_total": 1,
  "values": [
   {
    "company": {
     "id": 3612573,
     "name": "\uff01\uff01"
    },
    "id": 513645688,
    "isCurrent": true,
    "title": "S"
   }
  ]
 }
}

Positions whose id is TmfAl8Gr6E:
{
 "positions": {
  "_total": 0
 }
}
时间: 2024-10-01 04:25:56

Python 显示LinkedIn用户作业的相关文章

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 显示调用栈

Python调试不如强类型的语言方便,显示调用栈有时非常必要,inspect模块很好用 import inspect inspect.stack() inspect.stack()返回的是一个函数栈帧列表如(已经做了一个for e in inspect(): print e 转化) (<frame object at 0x7f6ec27b2050>, '/usr/lib/python2.7/dist-packages/oslo/config/cfg.py', 495, '_is_opt_reg

Python 访问 LinkedIn (API)

CODE: #!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on 2014-8-16 @author: guaguastd @name: login.py ''' # twitter login def linkedin_login(): from linkedin import linkedin CONSUMER_KEY = '' CONSUMER_SECRET = '' USER_TOKEN = '' USER_SECRET = '

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: linkedin_connection_retrieve.py ''' # import login from login import linkedin_login # import json import json from prettytable import PrettyTable # acc

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显示图形交互窗口

本文主要讲解如何使用Python编程(http://www.maiziedu.com/course/python/)显示一个交互的图形窗口.就以打印公共IP网络作为一个例子.为了执行代码显示公共ip,我们首先要完成密码验证过程.一旦密码被验证我们就能够看到我们的公共ip显示在终端窗口中. 为了成功地完成这个简单而有趣的项目,我们将使用一个叫做PythonZenity的库.这个库包含东西很少但是却有一些神奇的包在里面.在包中,我们将使用其中的一些包用在我们的项目,并且我们会有一个清晰的理解关于我们