Notification Trigger event - facebook-graph-api

I have a social marketing admin for my clients. I want to be able to update the admin when there is a new notification on their facebook fan page or a check in at their location.
Currently facebook sends me an email notification (for example when someone posts on the fan page wall). What I need is for a script to run that updates my admin whenever there is a unread notification.
What I don't want is to have to run a cron job every minute that grabs notifications. I have a lot of clients and a lot of fan pages. This would become very taxing.
Is there a way for facebook to push the notification to my script page instantly instead of querying every minute?

Real-time updates for pages do not cover feed content yet.
Currently facebook sends me an email notification (for example when someone posts on the fan page wall). What I need is for a script to run that updates my admin whenever there is a unread notification.
You could pipe incoming mail to a script, have it analyze the mail body (what page it was send for), and then trigger the notification …

Related

Is there anyway to initiate chat in dialogflow?

I am working in Dialogflow right now, is there any way to initiate chat using webhooks instead of using the common welcome massages given by dialogflow or some chat apps. Like I want to have my own initialize chats for many different situations. For example, today is my day to save money, then it will initiate a chat to make sure user get into save_money_daily intent. More details on the comment
There are few things that you wanted to do here that are not natural, I guess. Let me go on each:
How can I send an automatic chat for every possible case from the backend automatically?
Ans: You are building a google assistant on dialog flow, using as a chatbot, any chatbot can not send an automatic message(unless set by user), chatbots, and assistants are in the nature of the user interaction.
Let's any bot on Facebook, Skype, or any platform even the google assistant, they can't popup unwantedly with any information, it will be not user friendly.
There is a way to do, like if the user is interacting with your bot: You can ask like:
'Do you want me to remind you for saving money every day'
If user gives permission, save it in-app local cache and send app notification, via. Once the user get the app notification you can invoke the chat on the app notification click and open chat screen with your reply, but in the background when the user clicks on app notification you have to send a request to initiate chat.
And this solves your second problem as well.
Let me give you a high-level example:
Three Intent: With some user utterance
GetLatestMoive: ['get me the latest moives list']
GetLatestNews: ['Headline for today']
HealthCheck: ['I want health tips']
Create Notification and send it to the user via the app:
Based on the notification if the user clicks any of them, initiate your chat in-app with that utterance, it will automatically call the intent, and rest will follow based on your intent follow up a map and conversation design.
Hope this helps!

Calling Zapier trigger from Django Code

Is there any way I can call the "Zapier trigger" from my Django Code,
Basically, I am having a Django form where the user will enter several email-id and when the user clicks on send button then I want to send this form data to Zapier in order to do the next action like writing in google spreadsheet or sending email to everyone.
David here, from the Zapier Platform team. The easiest way to do this is to have the form submit against your server and use a library like requests to POST to Zapier. This way, you don't have to worry about CORS or revealing the hook url to your users.
Hope that makes sense. ​Let me know if you've got any other questions!
I am not sure from your question if this is related to how to make the call from Python (which #xavdid answered) or how to trigger a zap. If this is about triggering a Zap, here's the answer.
Setup a Zap by choosing the Webhooks by Zapier app as the trigger. Choose catch a raw hook, if you need more control. In the next step, you will receive a URL where you can POST your form-data.
Everytime you POST data the Zap will be triggered. You can use the data available from your request in the action step for Google Sheets or Emails.
Here are a few Zap Templates that you could start from.
Add info to Google Sheets from a Webhook POST
Send emails from a Webhook POST (Using Zapier's email app)
Send emails from a Webhook POST (using Gmail)

Django : notifications refresh automatically

I created a notification system adapted to my website and it's works. When a user is on home page, he can see his notifications.
But currently, for refresh his notifications the user have to reload the home page... (currently notifications visibles only on home page)
I want the notifications refresh automatically where there is a new notification, so without reload the page.
I want also user can be alerted by a new notification in all pages of my website (example : a div appears with notification
message).
How can I do this ?
Thank you !
PS : My Notification is very simple, so a Notification model with a Manager.
You can probably look at websockets. Check this out tornado
I dont know how you have setup your notification system, but making the use of websocket with combination of javascripting is way to go in my opinion.

Is there a Django app to aggregate/consolidate notifications to be mailed at once?

Today our website emails the user for every "event" who needs to be notified, but the number of "notifications" is becoming huge, annoying our users with tons of daily emails. Instead, I want to aggregate the notifications and send only one email every day.
I found this project, who seems to be exactly what I need: http://code.google.com/p/django-mailer/
A reusable Django app for queuing and throttling of email sending, scheduled sending, consolidation of multiple notifications into single emails and logging of mail failures.
Sample Use Cases:
(...)
a user doesn't want individual emails for each notification but wants them in digest form (e.g. a daily digest of new posts or a weekly update on friends who have joined)
(...)
NOTE: Now moved to http://github.com/jtauber/django-mailer/
Looks cool, but there are no code at all doing this at the Github repo and there are no more code at Google Code.
Do you know some alternative? (other than code it myself)
You'll need some service running in the background, otherwise what would trigger the email batch? I would use django celery email to do this. You'll need to set up celery first.

How do I receive Facebook notifications via the API when the newsfeed has changed?

I am using the facebook graph api and c# sdk to make a desktop facebook application to notify users of new posts and messages in facebook. I can get the news feed (/me/home, in graph api talk), as well as messages, events, pokes, etc, but I have not been able to retrieve notifications such as when one of my friends "friends" someone else, or when one of my friends changes their profile picture. What does facebook call those notifications anyway? So, are those things available with the graph api? What about REST?
You can do such things with Facebook Real-time Updates. You can subscribe to events on objects (user, page or permissions) and Facebook will monitor changes on these object and call a callback url when changes happen.
You can watch changes of fields (name, email, ...) but also connections (friends, likes, inbox, ...).
Let's say you subscribe to the friends connection real-time update for a user. Each time this user will have a new friend, a URL of yours will be called notifying you about the event.
Hope that helps.