Skip to content
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

Opportunity: handling likes nicely #5

Open
SamHames opened this issue Feb 16, 2022 · 0 comments
Open

Opportunity: handling likes nicely #5

SamHames opened this issue Feb 16, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@SamHames
Copy link
Collaborator

Having worked with the new Twitter like endpoints the data model is a real pain, which I think is a real opportunity for tidy_tweet to do something nice. The Twitter endpoints give the following information:

  • liking-users gives a reverse chronological list of user profiles liking the tweet
  • liked-tweets gives a reverse chronological list of liked tweets made by a user

In both cases, there is no indicator in the Twitter JSON of which tweet (or user) was liked by which user, however twarc injects the requested URL with that information into the __twarc field, allowing us to recover the proper relation from the data by itself.

A suggested approach is to insert the associated tweet/user profiles into the relevant tables, and create a liked_tweet table as below (with an index on (user_id, tweet_id) too):

create table if not exists liked_tweet (
    tweet_id integer references tweet(tweet_id),
    user_id integer references user(user_id),
    primary key (tweet_id, user_id)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant