Group user likes based on page category - facebook-graph-api

Is there a way by which we can group user’s facebook likes based on the category of the pages, when I request from Graph API /[user-id]?fields=likes what I get is array of user’s likes in reverse chronological order. I need to group these likes based on the page’s category like Entertainer, Comedians, Celebrity, Artist, Actor/Director, etc categories should be grouped in a one category (say Personalities) and other pages like TV Show, Movie, TV Series, etc to be grouped in other category (let’s say Movies)

No, you would have to do any sorting on your own, after getting all the entries. You can use paging to get all entries: https://developers.facebook.com/docs/graph-api/using-graph-api/#paging

Related

ActiveRecord querying on multiple joins

I have a users table associated with posts,
posts associated with comments,
comments associated with likes(status: 1,2,3,4). How can I sort the users based on likes count where status having 2 or 3 or 4.
Below I have tried:
named scope in likes model to get status with 1,2,3,4
Post.joins(comments: :likes).merge(Like.status_count)
But failing to the sort based on count. Any help
For ordering active record objects you can use order method, For Example
Assume a Users Database and i want to order it based on name, then we can do
User.order(:name) //Returns Users on ascending order of name
User.order(name :desc) //Returs Users in descending order of name
Similary you can try
Post.joins(comments: :likes).merge(Like.active.order(:status_count))
The documentation for the order method can be found in this link

Get the more repeated register in the database Django

I have to do statistics on the patient with medical visits, I'm trying to use annotate, but I doesn't work, the way I want it.
I need to get the member id(A7069001-03) with the more medical visits.
consultassub = consultasSubsecuentes.objects.annotate(num_id_credencial=Count('Consultasbc_credencial')).order_by('-num_id_credencial')[:5]
I get this:
A7069001-03
A7069001-03
A7039001-01
A7045053-01
A7045053-01
But I only need the one with more visits and the number of visits.

Facebook Graph-Api: Get name of pages

Iam new to the Facebook graph api.
I want to get all the names of the pages with more then a milion likes
This is my fql:
fql?q=SELECT name FROM page WHERE fan_count > 1000000
But i don't think that this is the right way. Is there a way to get all the names of the pages that meet the fql criteria?
No, the page FQL table is indexed only on id, name and username, not on fan count, so you can't query like this

drupal 7 - Grouping by taxonomy terms

I have a view called products, using product content type and are classified by the product taxonomy terms. I just want to show the Title and Picture from the node and group them by my tags.
tags:
fruits
dried canned goods
dairy
Surely you need to create a View.
In views you can make any filter for data and show in a new node, table, list, etc.

Google Charts - Multiple Category Filters - Restricting options?

I have 3 suppliers, 40 brands and 120 products, all displayed in three category filters. When a user selects one supplier from the Supplier filter, I want the Brand filter to hide all brands that are not provided by that supplier. Likewise, when a brand is selected, I want to hide the irrelevant products from the Products filter. I don't really care about what's being shown in the table at this point.
Is there any way to implement something like this?
Heres an example for you -
http://jsfiddle.net/danabnormal/cjn2tbbm
You can do this by creating a Dashboard. At around line 61 you can see that the selection made in the 'Sex' drop down is bound to the 'Name' dropdown, thus limiting what Names can be selected.
dashboard.bind(filterSex, filterName);
dashboard.bind(filterSex, pieChart);