Users/Friends with twitterizer that don't follow back - twitter

I am using twitterizer in an ASP.NET-project. I nned an example (code) how I can use twitterizer to show a list of followers (paged) for a special account that don't follow back.
The query is: Give me all users that I follow for e.g. 5 days but that didn't follow me back. The result should be displayed in a GridView with paging.
Thanks!

As I stated in the email, there is no way to filter friends or followers by date.
Your best bet to do this is to use TwitterFriendship.FriendsIds() and TwitterFriendship.FollowersIds(), then select the difference between the two. That will give you the list of followers that you don't follow. (Friends are users you follow.) In order to identify new friends/followers, you'll need to keep a list of the Ids, then consult that list at a later date to see the changes over time.

You could create a database (or list, etc) of users you followed and users who follow you. Update this as often you you need and add a time stamp for each new addition. Then you could query this database to create the list you want.

Related

How to get the Twitter follower count of a user on a given date, or at the time of a tweet?

I have access to Twitter API for Academic Research, and I'd like to get the follower count on a given date of a user, or at the time of a tweet.
The doc mentions that "This fields parameter enables you to select which specific user fields will deliver in each returned Tweet.", so I assumed that by adding public_metrics to the users.field, the number of followers can be seen in each returned Tweet, however, in each returned Tweet, I can only see user_id. https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference.
Is it even possible to achieve what I want with Twitter API for Academic Research? Is there any other approach to make it?
Thank you so much.
You cannot get the follower count on a specific date; it will always be the count at the time you make the API call.
You may need to add expansions to your API call in order to receive the values you are trying to pull out.

Firestore query with array of strings

I try to make social network (like instagram )
User have posts and followers etc
I want for home feed show posts just from users i follow.
User have array with ids of users he follow. So idea is to query from colloection “Posts” where id is equal to one of ids and sort them by timestamp and limit them.
I could make for loop for each in following array but this will be unusable for more than 100 following users.
Edit how I think it could be solved
Hello i dont know if im doing it right but here is my solution for social network like instagram or any other where one user follow other users and have feed from their posts ordered by date.
Each user have its own Collection Timeline where are posts references (postId, createdAt, createdBy) that user should see at his feed, when user start following other user it will put all his posts to feed. For display feed I just call on User timeline, sort it by date and request just 25 of them.
When user start the app I loop trough all followers and request their posts younger than lastTimeline timestamp from their posts collection if they have any I add them to timeline.
I would be happy for your opinion.
You can loop through all the followed user ID and then request the first 5 posts of each one.
Or use some kind of paging

Is it safe to "search" creating db records in Rails?

I need to build a search form including some fields like "city, price range, key word and date". I saw this video which is recommending to create a "searches" table. Every time any user made a search, it creates a table row in the db, and show the results depending on the submitted fields.
Seems easy to build but is it safe? I mean, if this is used in the practical world, I think we also have to use "I'm not robot" from Google.
https://www.youtube.com/watch?v=QRE7KxIvUb4&t=29s
Any idea is welcome.

parse query to see if friend info has changed

I am using parse as a server for my iOS application. One major component of the application is when a user updates their information, I want this new information to be available to their friends. Right now the only way i can think of to do this is by running a query with the current friend information and seeing if this matches the friend information. However, I do want to run a query for all friends as this would take a while. Is there any quicker way to accomplish this.
As an example
starting information
User: Name: Favorite color: Friends:
Daniel345 Daniel Blue David
and then the user changes the information to be
User: Name: Favorite Color: Friends:
Daniel1345 Daniel Green David
how can i structure a query so that David's friend information will be update to show that Daniels new favorite color is green?
I recommend you do this query to know if a user have changed any value, not a specific one.
You can do the following:
1) When a user (user1) adds a friend(user2) to it's circles you add this friend's(user2) id into a table of all friends.
1.1) In that table you can add a column called "updated". It will represent if the data of that user(user1) is updated in the user(user1) app.
1.2) the table should look something like this (user(pointer),friend(pointer),updated(number))
2) When one of the user(user1) friends changes (Updates) it's data you can change a boolean value(updated) in the friends list.
2.1) You will need to do that to all the it's friends.
3) To fetch the all the friends that have changed their data just get all the friends that the 'updated' value equals to 1
Basically, every time a User fetches all it's friends that have changed their data you reset all the 'updated' values back to 0. If a user haven't fetched the data and a one friend changes it's data twice then nothing happens, the value remains 1 (Think of this value as a way of letting you know that you have an update in one/some of your friends)

How to build rails analytics dashboard

I'm looking to build an analytics dashboard for my data in a rails application.
Let's say I have a list of request types "Fizz", "Buzz", "Bang", "Bar".
I want to display a count for each day based on type.
How should I do this?
Here is what I plan on doing:
Add get_bazz_by_day, get_fizz_by_day, etc to the appropriate models.
In each model get all records of type Fizz, then create an array that stores date and count.
format in view so a JS library can format it into a pretty graph.
Does this sound reasonable?
Depending on number of records, your dashboard can soon get performance problems.
Step 1 is misleading. Don't get the data for each day individually, try to get them all at once.
In Step 2 you can have the database do the the aggregation over days, with the group method.
See http://guides.rubyonrails.org/active_record_querying.html#group
Fizz.select("date(created_at) as fizzed_day, count(*) as day_count").
group("date(created_at)")
In Step 3 you need to take care that days without any fizzbuzz are still displayed, as they are not returned in the query.

Resources