SMS Facebook like count when reaching a threshold - facebook

I am looking for a way to automatically send SMS updates when a Facebook page is reaching a certain like count. I want to know when https://www.facebook.com/Foodler?ref=stream&fref=nf is nearing 100,000 likes automatically via SMS. Is this possible?

Ok, you have to break down your tasks. These are 2 separate concerns.
1 Track Facebook page constantly for likes
You can get this information by using Facebook's Graph API as a JSON record. A simple call (without requiring any API key will do the job)
http://graph.facebook.com/Foodler/
Right now, the "likes" key has value 97542
You can possibly run a cron-job or Scheduled Task (depending on your server type/configuration) to run a script (PHP/ASP/.NET, etc.) which further runs this API call every "X" minutes (or hours or days, whatever you wish) and parses the "likes" returned. Once they are >= 100,000, you can now send SMS using this script.
Your script can do so by now calling the SMS Gateway's API.
2 Sending SMS
You need an SMS Gateway (preferably a simple API?) for doing that. Just a simple google search for "sms gateway" returns many leading ones.

Related

Facebook Api Bulk message as Page

I'd like to use the endpoint '{conversation-id}/messages' to send bulk messages. According to the latest update on policies i can send 1 message to each user (says nothing about the users count) outside the 24 hours window ( when i can send multiple messages ).
Can anyone confirm to me that "The restriction on promotional content has been removed for standard messaging." includes the Api endpoint i stated above? is it standard as in non-'bot-like'? or standard as in using the web app ?
Also, if i break the policies in this regard, do they ban the app, the developer or the page?:D

Facebook Messenger Send Api - send to a big amount of users

I have a bot over Facebook which people are subscribing for sports updates.
I have 1,000 - 10,000 users I want to send out an update to.
Currently, in small scales like 20 messages , I would use a Facebook Batch request.
But, i'm not sure what would be the best way to send my messages in a large scale.
My two options are:
Batch - limited to 50 requests per batch request.
I don't really know if I should expect a delay in the execution of the request.
Regular calls - I will iterate through my receivers and send each of them a message separately.
I'm afraid Facebook might block me for thinking i'm spamming, or I will exceed the rate limits.
I have to say I was expecting a more generic method coming from Facebook since they are allowing users to subscribe for update through my bot, hence, I was expecting them to provide a guide on what are the best practices for sending the update users subscribed for.
You should definitely use Facebook Messenger Broadcast API for this. This will broadcast your message to all user subscribed to the bot.
Caveats:
You have to apply for this permission. (pages_messaging and pages_messaging_subscriptions.Takes about 1-2 days, but
can test on Admin/Test users of the app)
Each broadcast has to be a separate broadcast. (e.g. you can't send image and a text together, each has to be its own individual broadcast).
Have some kind of un-subscription option as well. FB user might think you are spamming even if you clearly say in the messages that your bot will send updates.
Use custom labels to create targetted sends. So you can either subdivide who you will send updates to about specific issues or just label people if they unsubscribe to your broadcast or not.
Basic workflow:
Get permission to broadcast.
Create message_creative_id via POST to endpoint
Use message_creative_id to POST a broadcast_messages
On a successful send you will get back broadcast_id

How can my app facilitate a message to multiple friends?

I have a facebook app that needs to allow a user to send a message to multiple friends (potentially all their friends) at once. This isn't any kind of spam, and I don't need the app to send the message incognito (behind the scenes), I just need to open a dialog with specific friends pre-populated (that the user has selected within my app in a prior step) and then send them a custom message. Is this possible? I see the api for sending a message to a single friend, and I see the API for inviting users to my app (but that's limited to some very small number of invitations per day)... what I need is a dialog that lets me send messages to as many of the user's friends as they want, but for me to control *which friends are selected... I don't want to give them control to add/remove from the friends list.
Is this possible?
No, the Send Dialog allows prefilling only a single friend, but would otherwise be the best option here if you need a custom message displayed to the recipient. You could get the user to send to several friends in a loop by prefilling this - or fire the dialog without prefilling and let the user chose who to send to - your app won't receive a callback with the recipient IDs but you could put a referrer param in the URL sent?
Failing that, the Requests dialog / 'invites' are the only thing you can prefill with multiple recipients without the expectation that your app will be shut down for spam shortly thereafter - there's no limit per day on the number of requests sent, but you don't get to set the message shown to the recipient.
In case this is helpful to anyone else, I just found this... it's a relatively new API (still in beta) that allows for (just about) exactly what I was asking for. I've tested it and it appears to work...
https://developers.facebook.com/blog/post/2012/08/31/reach-users-1-1-with-the-notifications-api/

Possibility on implementating sending Direct message using Twitter API

I would like to know how to send Multiple Direct message on Twitter. In my app using twitter api, i am able to send Direct message to one( Using DM Syntax ).
Currently i can see some tools like MultiDM website allows to send multiple Direct messages at a time.
So is that possible from iPhone's twitter api?
Also i wonder how the MultiDM website works as such
Pls let me know
In twitter API there is only 1 method of sending a DM: https://dev.twitter.com/docs/api/1/post/direct_messages/new
If you need to send multiple DM's - just call this method multiple times (with different recipient)
Yes you cant send DM to more than one user in a single call of the API.
If you want to send DM to multiple users, just make an array of all users id or screen name and in a loop send direct messages to All through the below API...
https://dev.twitter.com/docs/api/1/post/direct_messages/new

Multiple emails from PHP application using Gmail SMTP

I am working on an application which need to notify around 100 people at once when a specific condition is met. Now when a user who is performing the action which results in the specific condition need to wait till all 100 emails are sent which takes quite long using Gmail SMTP. The application is built on top of Cake PHP.
My question is whether there is a way application can send 100 emails without blocking the user whose action results in meeting the specific condition.
To make my question clear, think of Groupon. It sends notification to all buyers when minimum numbers of buyers are met. So when the nth person make the purchase, Google sends the notification.One way is to notify all buyers immediately after the purchase is complete (which is what we are doing n context of our application) and probably other way is to wait and send the notification using an external script/app at a pre-defined time.
In case of former, the application would block while sending emails is complete. Since PHP deosn't support multi-threading, I was wondering if there is an easy way to make this operation asynchoronous so it doesn't affect main application flow.
You could put the notification in a queue, and use a cronjob that checks and sends notifications every 5 minutes. That way your user isn't locked up while the operation happens.
I'm not 100% sure, but you might be able to use an ajax call too, which would keep the user free to carry on after the request is sent.