Facebook Realtime Subscription to individual wall posts? - facebook-graph-api

I've set up a Realtime Subscription for object user and fields feed and I am receiving realtime posts from Facebook.
I'm not interested in getting an update about every little thing that happens on every user's feed though. Is there a way to subscribe to just a single post?
My app is making a post to several user's feeds and then I would simply like my app to monitor anytime that specific post is liked or commented on.
Is it possible to subscribe to a certain post?

In current implementation of Realtime Updates seems like it is impossible, because you can not subscribe to specific object. Furthermore updates information that you receive doesn't contain any identifying information like post ID.

Related

Realtime Updates from FB API

I have a working Azure function that receives updates when I use the Graph API Explorer.
All I want to be able to do is submit a UserId to an endpoint and have any Posts they make sent to my WebHooks. We want to do this without the users always having to give permission. Unfortunately, I find the FB docs very confusing as most pages only have partial examples and the majority of the online SO or blog examples are far out of date.
On the FB WebHooks page it says
For example, if you subscribed to the user object's photos field and one of your app's Users posted a Photo, we would send you a POST request that would look something like this
They then say
You can also do this programmatically by using the /{app-id}/subscriptions endpoint for all Webhooks
On the Subscriptions page they have this example
POST /v12.0/{app-id}/subscriptions HTTP/1.1
object=page&callback_url=http%3A%2F%2Fexample.com%2Fcallback%2F&fields=about%2C+picture&include_values=true&verify_token=thisisaverifystring
But then its says this under Permissions
Subscriptions for the object type user will only be valid for users
who have installed the app.
This is not for a mobile app..so I'm confused
The above is to show that I have made all attempts to get this working without first posting here.
Now, I have to ask. Do anyone have experience or a existing code that demonstrates how to Subscribe to a User so that when they Post, I receive Notifications via webhooks?
Or, this this entirely the wrong way to use the Webhooks?

How to add another option to the share functionality of Google Glass?

I am interested to add my service into the share functionality of the Google Glass, my flow is below:
1. Take photo / Record video
2. Share with -> My service
3. the photo or video should be uploaded to my site
Is this functionality possible? it is very similar to Facebook and G+ share options.
I will be happy to know how to do it, Thanks.
What you are looking for is what the Mirror API calls a Contact. Your Glassware can setup one or more Contacts, specifying what content type can be shared with you and/or if there are voice commands which will trigger the Contact.
You will also need to setup a Subscription which will be the public URL for an HTTPS enabled server that the Mirror API will use to send you the content that was shared with the Contact.
In general, the flow when a user first authorizes you to write to their time would be something like this:
Add a Subscription, so you can get callbacks.
Add one or more Contacts. In your example, you would want to register the Contacts to have acceptTypes of image/* and video/*, although you can also omit the acceptTypes to get everything (including text).
The callback you register with the subscription should be able to handle a JSON body, and should return HTTP code 200 as quickly as possible. A good procedure is to actually accept the body, place it on a job queue for processing later, and immediately return the 200 code. When processing the body, you may want to do something like
Confirm the userToken and verifyToken provided are valid.
Using the itemId, get the Timeline item, which will include attachment information about what was shared with you.
If the attachment is marked as isProcessingContent, then the content isn't ready for you and you should return the job to the queue and try again soon.
If isProcessingContent is false, you can use the attachment URL with the authentication token for the user to fetch the content itself.
There are a lot of details I've glossed over here. For a further overview of the flow, see https://developers.google.com/glass/develop/mirror/contacts

Facebook like notification updates using django signal or notification

How can i use django-notifications or django-signals to make something like facebook updates notification that shows in the user profile if any other user likes or posts comments on user's blog or posts?
For the activity feed, we use https://github.com/justquick/django-activity-stream Documentation: http://justquick.github.com/django-activity-stream/
For the js widget and live notifications, we use https://github.com/subsume/django-subscription yourlabs example, it depends on redis but you can easily add a model backend if you really want to. Redis is a good choices it's half a megabyte of dependency. Documentation: http://django-social.rtfd.org
There is no application that does meta-notifications ("notification groupping") properly but a lot of research has been done. Basically you need another app, with a MetaNotification model, and something (management command, signal ...) that will visit notifications and create MetaNotification instances. Then you should display MetaNotification lists rather than Activity or notification list.
Finnaly, if you want configurable email notifications then you can use django-notifications: https://github.com/jtauber/django-notification or this app which looks nicer: http://www.tomaz.me/django-notifications/
I'm not aware of any app that does it all. It is going to be some work for you.
"It's a long way to the top if you wanna rock'n'roll" or as I like to say "patience and perseverance" :)
https://pypi.python.org/pypi/feedly allows you to build newsfeed and notification systems using Cassandra and/or Redis. Examples of what you can build are applications like the Facebook newsfeed, your Twitter stream or your Pinterest following page.

Comments though Real-time update API

I'm trying to develop an analytics application for Facebook and I would like to count for example the number of comments a user has submitted to any kind of objects (posts, links, photos, etc...)
From browsing though the Facebook API I've noticed that the comments table is not indexed on the from user id field which means that we cannot query, for the comments starting from a user object (one has to first use a post or other object to get the comments).
I'm wondering if I could get a notification through the Real-time updates API when a user posts a comment. Also what exactly are the fields one could get notifications about through the real-time API (namely all the fields
The fields that you can get from Real Times updates API are descripted in official docs[1]
[1] http://developers.facebook.com/docs/reference/api/realtime/

Real-time updates only for app's users?

I've been reading the real-time updates documentation for a while and I can't seem to find an answer. Can I use this feature only for the app's users? Can't I define a list of IDs that I want to receive the public feed from(even though not app's users)?
Thanks a lot
From the documentation:
Objects
You can currently subscribe to updates for these types of objects:
user – Get notifications about particular fields and connections
corresponding to user nodes in the Graph API.
permissions – Get
notifications when your users change the permissions they afford your
applications. The fields are like those in the corresponding FQL
table.
page - Get notifications when pages that have installed your
application change their public properties. Note that the page topic
is only used for subscribing to changes to public attributes of the
page (like name, category, picture etc). This is the same information
that is returned by the graph api call
https://graph.facebook.com/. You can subscribe to the page's
feed in the same way you subscribe to a user's feed - the subscription
topic should be 'user' and the subscription field should be 'feed'
These objects are related to YOUR application, so it would be updates from users of your applications, permissions related to your application, etc..