一次调用Linkedin的api / ugcPosts和/ socialActions即可检索喜欢的摘要(如果也有评论)

时间:2019-11-16 12:33:55

标签: api linkedin linkedin-api

正如标题所述,我正在尝试在单个调用中获取摘要数据。以下是我所说的:

curl  -H "X-Restli-Protocol-Version:2.0.0" "https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List(urn%3Ali%3Aorganization%3A{MyCompanyId})&oauth2_access_token={MyAccessToken}" | python -m json.tool

示例响应如下:

{
        "author": "urn:li:organization:###",
        "contentCertificationRecord": "{\"spamRestriction\":{\"classifications\":[],\"contentQualityClassifications\":[],\"systemName\":\"MACHINE_SYNC\",\"lowQuality\":false,\"contentClassificationTrackingId\":\"9F010B9AAF853F048D7BD9D0C15E8B8E\",\"contentRelevanceClassifications\":[],\"spam\":false},\"originCountryCode\":\"ph\",\"modifiedAt\":1573899825323}",
        "created": {
            "actor": "urn:li:person:##",
            "time": 1573899825261
        },
        "distribution": {
            "distributedViaFollowFeed": true,
            "externalDistributionChannels": [],
            "feedDistribution": "MAIN_FEED"
        },
        "firstPublishedAt": 1573899825261,
        "id": "urn:li:share:6601414332586790912",
        "lastModified": {
            "actor": "urn:li:csUser:7",
            "time": 1573899826914
        },
        **"<WHAT I'M LOOHING FOR>comments": {...},**
        **"<WHAT I'M LOOHING FOR>likes": {...},**
        "lifecycleState": "PUBLISHED",
        "origin": "DESKTOP",
        "specificContent": {
            "com.linkedin.ugc.ShareContent": {
                "media": [
                    {
                        "media": "urn:li:digitalmediaAsset:C5122AQHMuzOUz9SQfw",
                        "originalUrl": "https://media.licdn.com/dms/image/C5122AQHMuzOUz9SQfw/feedshare-shrink_1280/0?e=1576713600&v=beta&t=uFgX1A7eqBrgik-kbyvFzJah1-3b3mGZqm1RknR_nRM",
                        "status": "READY",
                        "thumbnails": [
                            {
                                "height": 633,
                                "url": "https://media.licdn.com/dms/image/C5122AQHMuzOUz9SQfw/feedshare-shrink_1280/0?e=1576713600&v=beta&t=uFgX1A7eqBrgik-kbyvFzJah1-3b3mGZqm1RknR_nRM",
                                "width": 950
                            }
                        ]
                    }
                ],
                "shareCategorization": {},
                "shareCommentary": {
                    "inferredLocale": "en_US",
                    "text": "something"
                },
                "shareFeatures": {
                    "hashtags": []
                },
                "shareMediaCategory": "IMAGE"
            }
        },
        "ugcOrigin": "DESKTOP",
        "versionTag": "1",
        "visibility": {
            "com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
        }
    },

facebook API中也提供了类似的操作,我觉得在Linkedin中也绝对有可能。

0 个答案:

没有答案