Repository navigation
[17.0][ADD] social_media_x_sync - #6
Merged
Merged
Conversation
… conversation of each post Bridge between social_media_sync and social_media_x, auto-installed with both. It holds everything whose cost against the X API grows with the history of the account, so an installation that only publishes on X pays a fixed number of calls per account. - Timeline import, one page of up to 100 original publications; photos, videos and animated GIFs are downloaded once as attachments, the videos through _store_remote_videos of social_media_sync, so the system parameter social_media_sync.download_videos leaves them out. - Account statistics as the sum of every stored publication. - Comments through the recent search endpoint, up to five pages of a hundred. - Recommend on publications and comments, and Delete on the account's own comments. - Import checkpoint (enable_since, post_since_id, last_post_ref), moved here from social_media_x. - Reposts and quotes filters and optional list columns. The bihourly check imports on X instead of flagging the account, since reading the timeline is already the import.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@BinhexTeam
T25184
Adds
social_media_x_sync, the X half ofsocial_media_sync. Auto-installed whensocial_media_syncandsocial_media_xare both present. It declares no Python dependency of its own and relies on the tweepy dependency of the connector.Why a separate module
The split from
social_media_xis a cost line, not a feature line. The connector spends a fixed number of calls per account however much that account has published: link it, refresh its card, publish, delete, read the figures of the publications of the last 30 days, read the single publication being opened.Everything whose cost grows with the history of the account lives here: the timeline, one download per media not stored yet, and up to five calls per publication whose comments are read. On top of that, one page of the latest likes of the account is read on every import and when the comments dialog opens. It is one call, but X charges every post it answers, up to 100. An Odoo that only publishes on X installs
social_media_xalone and pays for none of it.What it adds
next_tokenis not followed). Retweets, replies and quotes are discarded. Photos are downloaded once from their address. Videos and animated GIFs are downloaded from their mp4 variant with the highest bit rate. All of them are stored as attachments, the videos through_store_remote_videosofsocial_media_sync, and thet.colinks X appends for those media are stripped from the text. The system parametersocial_media_sync.download_videosset toFalseleaves the videos and animated GIFs on X while the photos keep coming; the publication keeps its video mark and the next import downloads what is missing once the parameter is back on.POST /2/users/:id/likesandDELETE /2/users/:id/likes/:tweet_id, with the user context of the account. Whether the account already liked a post is read from one page of its latest 100 likes, so an older like is not seen.DELETE /2/tweets/:idalready used for publications. A comment already gone on X counts as deleted.social_media_x, are respected for the timeline, the recent search, the reply, the likes and the delete. While a window lasts:Scheduled actions
The passes of
social_media_syncplus two ofsocial_media_base:social_media_x, not of this moduleThe bihourly check skips any account whose first import has not run yet, because that check and the initial import write the same row from two threads.
Not implemented
last_post_ref,enable_sinceandpost_since_idmove fromsocial_media_xto this module, so an existing database needsir_model_fieldsupdated before uninstalling the connector, or a recreation.Requirements
A paid X API plan, the same one the connector needs: the user timeline, the recent search and the likes are API v2 endpoints and answer
403outside a Project.Tests
social_media_x_sync/tests/:test_sync_account_x.py,test_sync_post_account_x.pyandtest_sync_utils_x.py;test_card_footer_x.py,test_comment_dialog_x.pyandtest_post_reaction_x.py, which drive the tourssocial_card_footer_x,social_comment_dialog_xandsocial_post_reaction_x.The notice of the Update button comes from
social_media_sync, which words it from the accounts the import read, so this module adds no notice of its own.Every HTTP call is patched; no network access.
Depends on
social_media_x.social_media_sync, which adds_store_remote_videos,social_media_sync.download_videosand the Update notice worded from the accounts read.social_media_baseand [17.0][FIX] social_media_linkedin #2social_media_linkedin, whichsocial_media_xneeds.All of them are installed by the CI from
test-requirements.txt, in a[DON'T MERGE]commit.