How to post Movies I've "Watched" or "Want to Watch" via Open Graph? - facebook

I would like to be able to have my application's users have the ability to add movies they've "Watched" to their Timeline - specifically in the "Movies" collection of their Timeline, as show here:
It appears that these activities are solely published via the "Movies" application (an internal Facebook-controlled application). Is there no way to programmatically add a movie to one of these collections via the video_watches or video_wants_to_watch action?
I can see that any application can post via these actions via the documentation
https://developers.facebook.com/docs/opengraph/guides/video.watches/
https://developers.facebook.com/docs/opengraph/guides/video.wants_to_watch/
but they end up "sandboxed" under a different application's Collection (if the application has a Collection set up for that particular action/object pair).
Additionally, there seems to be no way to tie an application's collection data to the Movies collection like the Music collection seems to - which is how I would assume the third-party application's video_watches data would append or combine with Facebook's "Movies" application data.
I have tried to follow the documentation at https://developers.facebook.com/docs/opengraph/guides/collections/#datatodefaultsections to create a URL with which to integrate the application data, but it does not appear to function at all.
https://www.facebook.com/me/movies?[appname] simply does nothing. It just brings you to the "Movies" collection on your Timeline with no option to add your app's data to that section. Nothing like what's shown here (from the Facebook documentation) for Music, giving you the option to add your application's data to the Movies collection:
Is this something exclusive only to the "Music" collection at this point? When will the other "first-party" collections (other than Music) accept "third-party" application data?
See also related questions:
http://facebook.stackoverflow.com/questions/15759032/facebook-api-to-get-watched-movies-tv-show-list-or-read-book-list
http://facebook.stackoverflow.com/questions/15886745/how-does-one-enable-an-apps-data-to-be-added-to-users-default-sections

You need open graph items to use this method: https://developers.facebook.com/docs/reference/opengraph/action-type/video.wants_to_watch
If you use a open graph object of type movie.other you can use:
https://graph.facebook.com/me/video.wants_to_watch?access_token=ACCESS_TOKEN&method=POST&other=http%3A%2F%2Fsamples.ogp.me%2F467235199955838
I use trakt.tv to get the movie open graph objects. For example if you want to add Star Wars Episode VI to your whatchlist on facebook you can use:
https://graph.facebook.com/me/video.wants_to_watch?access_token=ACCESS_TOKEN&method=POST&movie=http://trakt.tv/movie/star-wars-episode-vi-return-of-the-jedi-1983
Note that in trakt.tv the open graph is movie.
You can also do the same to add watched movies, rate it, add books, music... https://developers.facebook.com/docs/reference/opengraph/action-type

Related

Get App Store rankings by API or RSS generator

I want to track my app's ranking on the App Store and have found https://rss.itunes.apple.com/en-us
It pretty much does what I need except for the fact that it only distinguishes between "games" and "all" - there is no option to just say "apps" (excluding games).
Also, I cannot set categories e.g. "Finance" etc.
My workaround would be to get both lists, make a new list that filters all "games" list entries from the "all" list and then check for each app's category by scraping the iTunes website.
However, I don't think that this is the way to do it.
Is there another API to use or an undocumented part in the rss generator that allows for what I am looking for?

Facebook URL Graph Search - Page Queries

I am looking to generate a list of URLS or FB ID's for a set of existing Facebook Pages. Ultimately the initial query I am looking to run is simple: Find all NEW facebook pages created in City XYZ.
The term NEW, is open to interpretation. It could mean "Created this month" Or newer relative others in a set (these details are not important at the moment) . Also, "Pages" refers to fan pages (not user profiles).
I have identified 3 possible approaches. Both of which I am hoping to get some input on. Regarding feasibility and process.
Option 1) Somehow leverage Facebook's Graph API and develop some time of web application to generate a list of all Pages, then filter by city, then filter by date created.
Option 2 (Best Case)) Write or generate a custom Graph Search URL with embedded search criteria and leverage FBs existing search feature to get results. A great example of this approach is used by the tool searchisback.com. Only this tool is used to do advanced searches on People, but I need advanced searches on Pages.
Option 3) Locate a tool that already does this that I can use.
I again hoping to get some input and possible some direction/recommendations.
I should also mention that I actually know very little about Facebook APIs and Facebook Development. My position right now is of some who knows what they want to do, but no idea how to do it.
Option 1: Not possible, you can only search for Pages by name, the Graph Search is not available with the API. Those are all the options: https://developers.facebook.com/docs/graph-api/using-graph-api#search
Option 2: See answer to option 1.
Option 3: There are tools that list Pages, but they all have to add them manually. So there is not really a tool that does what you want to achieve.
In short: What you want to do is not possible.

Query near public events via Facebook API v2.2

I want to retrieve a list of upcoming public events in my hometown from the Facebook Graph API.
I already know that FQL is deprecated and that I can query by keywords using a statement similar to
/v2.2/search?type=event&q=Berlin&since=2015-01-27
However, this list is not enough because there are lots of events which do not contain the City Name either in the event title, description or Location name.
On the other hand I can retrieve a list of places within the same City by using
/v2.2/search?type=place&since=2015-01-27&center=52.52,13.41&distance=10000
In my assumption I could retrieve a better event list if I create a query stating "give me all public events (eid) of all given places within this city in a specified distance".
Does anybody know if this is somehow possible to query?
I am unsure if batch processing is the right way to go, or if there is another possibility to Combine These two entities. My simple Approach would be to query each given Place again by requesting
/v2.2/{placeid}/events
but I also know that Facebook has a rate Limit of 50 requests in this case.
Right now Facebook doesn't have a way to do what you want or at least not documented.
The only way I think you could it is:
1- Find with the facebook API the pages in one city. (You can do do this manually or search for places near the city and then use the places that also ara pages)
2- Get the events of the pages (if exists) and save this in a db also with the location of the place/page.
3- Show all the events of the city.

Facebook actions like spotify?

I'm trying to understand actions and objects on facebook and im completely blown away by how spotify publishes actions with that format. How the heck do you customize the layout of a user's action like that?
As far as im concern, with facebook's lovely documentation, all you can do is publish actions on a single line : (user A) -- (action) -- on -- (object) followed by a title and description.
How do you design html/css layout of a user's actions? Link? Attachment? I'm guessing you have to do some sort of "magic" on the description? Thanks!
Facebook's open Graph Tutorial does a decent job of explaining this but with the various options you have to scroll for a while to make it to the grouping part. In short, the individual actions you're familiar with combine together via "aggregations" which can be set to show a number of formats from lists to grids.
To set one of these up you must configure your Actions and Objects via the open graph settings first and then manually create an aggregation and a few defaults to fill in for preview purposes.
This will show up when a user authenticates your app for open graph and becomes customized to them as they start actually using said actions.
Now as for the play button option, that's something I assume is unique to their integration.
Documents at https://developers.facebook.com/docs/beta/opengraph/tutorial/

Facebook Graph API: Getting the total number of posts

I've been using the Facebook Graph API to display user posts. When I get the initial "page" of posts, the resulting data object has a paging property object with a previous and next URL property. I was hoping to generate navigation links based on this available paging information. However, sometimes these URLs point to an empty set of data, so I obviously don't want to navigate the user to an empty page.
Is there a way to find the total count of objects in a collection so that better navigation can be derived? Is there any way to get smarter paging data?
Update:
Sorry if my post isn't clear. To illustrate, look at the data at https://graph.facebook.com/7901103/posts and its paging property URLs. Then follow those URLs to see the issue: empty pages of data.
Since it pages the datas with date-time base. You can't get the knowledge of whether if there are datas or not before you actually send the request to it. But you can preload the data from previous url to determine is it suitable to dispaly a previous link in your web page.
Why be dependent of Facebook?
Why don't you preload all data for a user and save into a database. Then you fetch the posts from db and show to user. This way you have all the control on how many posts there are and how to manage next and prev.
I was going to try to post this as a comment to your question, but I can't seem to do so...
I know that the Graph API returns JSON, and while I've never come across a way to have the total number of posts returned, depending on what technology you are using to process the response, you might be able to capture the size of the JSON array containing the posts.
For example, if I were using a java application I could use the libraries available at json.org (or Google GSON, or XStream with the JSON driver) to populate an object and then simply use the JSONArray.length() method to check for the number of posts returned.
see:
http://www.json.org/javadoc/org/json/JSONArray.html
It might seem like a bit of a simplistic solution, but might be the type of work around you require if you can't find a way to have Facebook return that data.
Can you specify what technology your application is based in?