twitter: adding promoted_metrics to the API call
Signed-off-by: Alexis Pentori <alexis@status.im>
This commit is contained in:
parent
11efa92811
commit
36555d0c23
|
@ -10,7 +10,7 @@ data:
|
||||||
connectorSubtype: api
|
connectorSubtype: api
|
||||||
connectorType: source
|
connectorType: source
|
||||||
definitionId: 1c448bfb-8950-478c-9ae0-f03aaaf4e920
|
definitionId: 1c448bfb-8950-478c-9ae0-f03aaaf4e920
|
||||||
dockerImageTag: '0.2.0'
|
dockerImageTag: '0.2.1'
|
||||||
dockerRepository: status-im/airbyte/source-twitter-fetcher
|
dockerRepository: status-im/airbyte/source-twitter-fetcher
|
||||||
githubIssueLabel: source-twitter-fetcher
|
githubIssueLabel: source-twitter-fetcher
|
||||||
icon: twitter-fetcher.svg
|
icon: twitter-fetcher.svg
|
||||||
|
|
|
@ -3,57 +3,57 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": [ "null", "string"]
|
"type": ["null", "string"]
|
||||||
},
|
},
|
||||||
"text": {
|
"text": {
|
||||||
"type": [ "null", "string"]
|
"type": ["null", "string"]
|
||||||
},
|
},
|
||||||
"created_at": {
|
"created_at": {
|
||||||
"type": [ "null", "string"]
|
"type": ["null", "string"]
|
||||||
},
|
},
|
||||||
"author_id": {
|
"author_id": {
|
||||||
"type": [ "null", "string"]
|
"type": ["null", "string"]
|
||||||
},
|
},
|
||||||
"conversation_id": {
|
"conversation_id": {
|
||||||
"type": [ "null", "string"]
|
"type": ["null", "string"]
|
||||||
},
|
},
|
||||||
"reply_settings": {
|
"reply_settings": {
|
||||||
"type": ["null", "string"]
|
"type": ["null", "string"]
|
||||||
},
|
},
|
||||||
"referenced_tweets": {
|
"referenced_tweets": {
|
||||||
"type": [ "null", "array" ],
|
"type": ["null", "array"],
|
||||||
"items": {
|
"items": {
|
||||||
"type": ["object"],
|
"type": ["object"],
|
||||||
"properties":{
|
"properties":{
|
||||||
"type": {
|
"type": {
|
||||||
"type": [ "null", "string" ]
|
"type": ["null", "string"]
|
||||||
},
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public_metrics": {
|
"public_metrics": {
|
||||||
"type": ["null", "object" ],
|
"type": ["null", "object"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"retweet_count": {
|
"retweet_count": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
},
|
},
|
||||||
"reply_count": {
|
"reply_count": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
},
|
},
|
||||||
"like_count": {
|
"like_count": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
},
|
},
|
||||||
"quote_count": {
|
"quote_count": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
},
|
},
|
||||||
"impression_count": {
|
"impression_count": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
},
|
},
|
||||||
"bookmark_count": {
|
"bookmark_count": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -61,13 +61,36 @@
|
||||||
"type": ["null", "object" ],
|
"type": ["null", "object" ],
|
||||||
"properties": {
|
"properties": {
|
||||||
"impression_count": {
|
"impression_count": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
},
|
},
|
||||||
"url_link_clicks": {
|
"url_link_clicks": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
},
|
},
|
||||||
"user_profile_clicks": {
|
"user_profile_clicks": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"non_public_metrics": {
|
||||||
|
"type": ["null", "object" ],
|
||||||
|
"properties": {
|
||||||
|
"impression_count": {
|
||||||
|
"type": ["null", "number"]
|
||||||
|
},
|
||||||
|
"like_count": {
|
||||||
|
"type": ["null", "number"]
|
||||||
|
},
|
||||||
|
"reply_count": {
|
||||||
|
"type": ["null", "number"]
|
||||||
|
},
|
||||||
|
"retweet_count": {
|
||||||
|
"type": ["null", "number"]
|
||||||
|
},
|
||||||
|
"url_link_clicks": {
|
||||||
|
"type": ["null", "number"]
|
||||||
|
},
|
||||||
|
"user_profile_clicks": {
|
||||||
|
"type": ["null", "number"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -75,22 +98,22 @@
|
||||||
"type": ["null", "object" ],
|
"type": ["null", "object" ],
|
||||||
"properties": {
|
"properties": {
|
||||||
"impression_count": {
|
"impression_count": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
},
|
},
|
||||||
"url_link_clicks": {
|
"url_link_clicks": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
},
|
},
|
||||||
"user_profile_clicks": {
|
"user_profile_clicks": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
},
|
},
|
||||||
"retweet_count": {
|
"retweet_count": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
},
|
},
|
||||||
"reply_count": {
|
"reply_count": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
},
|
},
|
||||||
"like_count": {
|
"like_count": {
|
||||||
"type": [ "null", "number" ]
|
"type": ["null", "number"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ class Tweet(HttpSubStream, Account):
|
||||||
) -> str:
|
) -> str:
|
||||||
account_id = stream_slice.get("parent").get("id")
|
account_id = stream_slice.get("parent").get("id")
|
||||||
logger.info("Account id %s", account_id)
|
logger.info("Account id %s", account_id)
|
||||||
return f"users/{account_id}/tweets?tweet.fields=text,public_metrics,non_public_metrics,organic_metrics,author_id,referenced_tweets,created_at"
|
return f"users/{account_id}/tweets?tweet.fields=text,public_metrics,non_public_metrics,organic_metrics,author_id,referenced_tweets,promoted_metrics,created_at"
|
||||||
|
|
||||||
def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapping]:
|
def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapping]:
|
||||||
logger.debug("Twtter Response: %s", response.json())
|
logger.debug("Twtter Response: %s", response.json())
|
||||||
|
|
Loading…
Reference in New Issue