-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Twitter : adding ads_stream #21
base: master
Are you sure you want to change the base?
Conversation
twitter twitter
tweet = slice.get("parent", {}) | ||
yield { | ||
"promoted_tweet_id": tweet.get("id"), | ||
# "created_at": tweet.get("created_at") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it commented out ?
"id": stream_slice.get("promoted_tweet_id"), | ||
# "created_at": stream_slice.get("created_at"), | ||
# "stats_date": record.get("date"), | ||
"billed_engagements": record.get("billed_engagements", []), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont see any billed_engagments
for the endpoint.
https://developer.x.com/en/docs/x-ads-api/analytics/api-reference/synchronous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The metrics from the BILLING endpoint are described here : https://docs.x.com/x-ads-api/analytics#available-metrics-by-metrics-group
# "created_at": stream_slice.get("created_at"), | ||
# "stats_date": record.get("date"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why commented out ?
# "created_at": stream_slice.get("created_at"), | ||
# "stats_date": record.get("date"), | ||
"billed_engagements": record.get("billed_engagements", []), | ||
"billed_charge_local_micro": record.get("billed_charge_local_micro", []), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
@@ -0,0 +1,25 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the schema contains all those fields ? :
"segment": null,
"metrics": {
"impressions": [
1233
],
"tweets_send": null,
"qualified_impressions": null,
"follows": null,
"app_clicks": null,
"retweets": null,
"likes": [
1
],
"engagements": [
58
],
"clicks": [
58
],
"card_engagements": null,
"poll_card_vote": null,
"replies": null,
"carousel_swipes": null
}
```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also the date could be usefull
stream_state: Mapping[str, Any] = None, | ||
**kwargs | ||
) -> Iterable[Optional[Mapping[str, Any]]]: | ||
# Reuse TweetPromoted's stream_slices to get promoted tweets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i remember correctly doing a substream of a substream didn't worked for me.
Also if we can get the list of promoted tweet through an endpoint that could be cleaner that the lets try all tweet of the last month and see if we get any result
… tweets and active promoted tweets ids
Adding billing endpoint from x ads api that will get us the amount we spend on each promoted tweet
For now nothing is changed with the auth system.