• 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:eclipseLinkedIndfilelinkedin_connections.json'
    connections = json.loads(open(connections_data).read())
    
    # Display your own positions...
    print '
    My positions with all information:
    '
    my_positions = linkedin_api.get_profile(selectors=['positions'])
    print json.dumps(my_positions, indent=1)
    
    # Display your own positions...
    print '
    My positions with only company information:
    '
    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 '
    Positions whose id is %s:
    ' % 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 u4e92u8054u7f51u7cbeu82f1u8f6fu4ef6u5f00u53d1u4ebau624du62dbu8058u4e13u5bb6"
        }, 
        "summary": "SoftTalent Consultingu4e13u6ce8u5728u8f6fu4ef6u4ebau624du7684u641cu5bfbu3002", 
        "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": "u6210u90fdu540eu9662u79d1u6280u6709u9650u516cu53f8"
        }, 
        "id": 529513768, 
        "isCurrent": true, 
        "title": "u521bu529eu4eba"
       }
      ]
     }
    }
    
    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": "DMSu3001AMIu3001HANu3001CISu3001IEC-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": "uff01uff01"
        }, 
        "id": 513645688, 
        "isCurrent": true, 
        "title": "S"
       }
      ]
     }
    }
    
    Positions whose id is TmfAl8Gr6E:
    {
     "positions": {
      "_total": 0
     }
    }
    


  • 相关阅读:
    vue element-ui配置第三方图标库
    HTTP协议:状态码
    HTTP协议:无状态
    CDN:基础知识
    【转载】浅析机器视觉中的照明系统(该如何打光)
    nginx 端口转发
    Gitlab 备份 | 恢复 | 卸载 | 迁移 | 版本升级
    微信小程序支付服务端.net core实现,简单直接
    生产级gitlab备份
    背锅之旅:前任对我的爱-只备份不删除导致的磁盘爆满
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/4567247.html
Copyright © 2020-2023  润新知