ykdojo / editdojo2

This used to be Edit Dojo's private repo - now it's public.

Home Page:https://www.csdojo.io/edit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When a user signs up for the first time, retrieve their tweets

ykdojo opened this issue · comments

commented

We should retrieve all their tweets and store them in our database.

commented

Working on this now.

commented

Set: include_rts = False, exclude_replies = True

commented

and count = 100 or something like that.

@ykdojo I suppose you want to add this to a background task as well right? I can enqueue this task for every new signup to the worker dyno that periodically retrieve tweets as well.

commented

Yeah. I guess this issue should say, "When a user signs up for the first time, add them to one of our Twitter lists."

I think I should create another seperate queue, that adds them to the twitter list IMMEDIATELY instead of leaving it to the scheduled task to check new customusers if they are not in the twitter list yet.

This is just an assumption, but if I was a customer, I would like to contribute (start tweeting, etc) as soon as possible when I successfully authenticate / signup for the app.

commented

I think it's okay for tweets to take a little bit to come to our app. If it takes 1-2 minutes, it's probably reasonable to say "we're retrieving your tweets for you!" or something like that on the UI

Done. added a task to be enqueued when a new user authenticates. It'll just look for new users in the customuser model where already_in_twitter_list is false, and add them to it.

Done. added a task to be enqueued when a new user authenticates. It'll just look for new users in the customuser model where already_in_twitter_list is false, and add them to it.

I'll test and PR this as well

commented

I was just thinking, the only potential problem is something like this:

  1. We already have, say, 20 users on our Twitter list.
  2. A new user, say, @user21 signs up.
  3. And we've already retrieved recent tweets from the 20 existing users.

If we add @user21 to the list and try to retrieve the most recent tweets from the list, we might miss older tweets from @user21.

So, it might actually be necessary to retrieve tweets from a newly signed up user separately.

commented

(hope this makes sense to you @Jonathantsho)

@ykdojo Agreed. what I will do is tie the function to check for new users to add to the twitter list first, and then retrieve their tweets in the same function. That way it'll catch everyone who's newly added.

commented

Sounds good!