A real-time anonymous publishing application for Facebook pages.
The general method to provide an anonymous Facebook page for people is:
An administrator holds a Facebook page and provides a third-party service for people to post messages to a temeporay database. Once the administrator received a new message from a user, he/she has to manually review and publish the message to the Facebook page.
This project let you having an intelligent bot which is able to automatically perform the following jobs for you:
- Without any exceptions and unpredictable errors from Facebook API, this bot will directly publish the new messages from users to your Facebook page.
- A message queuing service will automatically start when too many messages have created by users within a short period.
- Anyone has the right to anonymously speak out his/her thoughts to the public through this application without need to login into his/her Facebook account or use any third-party applications.
- You are able to set your filters and senstive words to prevent abuse using and spam messages from haters.
- This bot works 24/7 without need to sleep.
This application is based on Laravel 5.0 (a PHP framework) and free/open on Github.
If you don't have your own server, the following instructions will teach you how to build your own Facebook Publisher on OpenShift (by using the Free Plan).
Note: if you face any problem in any of the steps you should report it at github
-
Click here to create a new Facebook page, select appropriate page type, fill in description and other relevant fields.
-
In your new Facebook page, switch to
About
tab and scroll down to the bottom of the page then note down theFacebook Page ID
. You will use the role and previlege of this Facebook page to post messages on this page's wall.
-
If you were not a Facebook developer, click here to register as a developer (You have to verify through mobile.)
-
Go to Facebook Apps dashboard ☛ Click
Add a New App
☛ Choose platform ofWebsite
☛ Choose a name for your application ☛ ClickCreate New Facebook App ID
☛ Choose Category ☛ ClickCreate App ID
-
Go back to Apps dashboard ☛ Select your new application ☛
Settings
☛Basic
☛ EnterContact Email
☛Save
-
Go to
Status & Review
☛Do you want to make this app and all its live features available to the general public?
toggle the button toYes
☛Make App Public?
, clickYes
-
Go back to
Dashboard
, note downApp ID
andApp Secret
(You have to clickShow
next to the field; it will ask you to enter your Facebook password.)
-
Go to Graph API Explorer ☛ In the Application drop-down menu, select the name of your app which created in Step 2 ☛ Click
Get Token
to open drop-down menu and selectGet User Access Token
☛ In Permissions popup menu, checkedmanage_pages
,publish_actions
andpublish_pages
☛ ClickGet Access Token
-
Note down the
short-lived token
which shows in the input field next to the Access Token label. -
Next, we are going to convert short-lived access token to a long-lived token. Please fill in the corresponding values to the following URL and open this URL in a browser:
https://graph.facebook.com/oauth/access_token?
client_id={APP_ID}&
client_secret={APP_SECRET}&
fb_exchange_token={SHORTLIVED_ACCESS_TOKEN}&
grant_type=fb_exchange_token
-
You will see
access_token={...}
. This new access_token is thelong-lived token
, next, we are going to use it to get the page access token which will never expire in the future. -
Go to Graph API Explorer ☛ Paste the
long-lived token
into the Access Token input field ☛ Typeme/accounts
in theGraph API
query input field ☛ ClickSubmit
button ☛ You will see the information of all your pages, find the Facebook page created in Step 1 and note down theaccess_token
of it. -
According to Facebook's documentation, a page access token obtained from long-lived user token will never expire in the future.
-
Go to Openshift create an account. Fill in your email and other required information ☛ Click
Sign Up
☛ Then you will receive a verify mail (go checking your inbox), clickVerify Your Account
☛ ClickI Accept
☛ ClickCreate your first application now
☛ In the application type list, findLaravel 5.0
and select it. -
Fill in your
Public URL
where has two fields. The first one is a string for recognizing your application, the second is your namespace. For example, I choose demo-anonykangxi.rhcloud.com in this demo ☛ Next, copy an paste the following URL to theSource Code
field:
https://github.com/kxgen/facebook-anonymous-publisher
-
Then click
Create Application
☛Will you be changing the code of this application?
clickYes, help me get started
-
Next step, we have to generate a ssh key for OpenShift to identify your device, open
Terminal
and enter:
$ ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
- You will see a prompted message of
Enter a file in which to save the key
, please enterid_rsa_openshift
, then hit enter again:
Enter file in which to save the key (/Users/yourname/.ssh/id_rsa): id_rsa_openshift
- It will ask you to enter a passphrase, press enter to use empty passphrase:
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
- Next, it will show the fingerprint or id, of your SSH key. It will look something like the following message:
Your identification has been saved in id_rsa_openshift.
Your public key has been saved in id_rsa_openshift.pub.
The key fingerprint is:
SHA256:KR08ZVqrfZUU0O4nY3TDyWVgZ2SIIDg5iCaPpi9BDMz [email protected]
- To review
id_rsa_openshift.pub
, you can use the following command:
$ cat ~/.ssh/id_rsa_openshift.pub
- You will see something like below text, copy the texts:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYcnn3tA4B0GUM4SxNA2zilkTuMGPpzHg4YEUitabUSimts9H4PuFBU00/N3w2jPCifzAicT+LHRZ0e9ksnXvVKdwH3GMA6FG92/Xepq2/F3Be3+jRB9EtHNY6Q6e5FtGn8M7PzbOQ2LpuSH65IjOqfVWCifuNdD/yZYCVRrv7UH4FnBXcdVa1t6rglbb4mrQbS9V5XB60Qrkth/n/PmSQU0CJct1tG1VOx7MYa7dGjlN/LC//Cb0DIa7lIj7ZjF873zKJ7R5Y4hOOHklHaS6+x1rO1YMjmykKXHK+ifs/iJiJHmha5vb9An602szw1KqGodZBoduZLjkGMdRn5QZJ [email protected]
-
Go back to OpenShift screen ☛
Paste the contents of your public key file (.pub)
, paste the texts which you has copied on the above step to this field ☛ ClickSave
-
Now you can clone the repository to your computer, copy the
git clone
command and open yourTerminal
☛ Paste the command and press enter -
Click
Continue to the application overview page.
link ☛ Copy theapplication URI
(for example, the URI in this demo is: demo-anonykangxi.rhcloud.com).
- Go to Google reCAPTCHA ☛ Fill the
Label
with your application name ☛ Paste the application URI in Step 4 to theDomains
input field ☛ InOwners
field, enter your email ☛ ClickRegister
☛ note down theSite key
andSecret key
-
Go to the repository folder which you have cloned in Step 4 ☛ Open
./config/publisher.php
with your preferred editor and configure the application settings. -
Then, open the
Terminal
and enter following commands:
$ cd /path/to/your/repo/folder
$ git add .
$ git commit -m 'update publisher settings'
$ git push
- When the git push has done, go to your application dashboard
http://yourdomain/admin/setting
and configure the settings. - Go to your application homepage and try to submit a testing message.
-
Go to Uptime Robot ☛ Click
Sign-up (free)
☛ In the popup, fill in your Name, E-mail and Password ☛ ClickSign-up
button ☛ Check your E-mail inbox, open the account activation email, click the activate link. -
Login to Uptime Robot ☛ In your dashboard, click
Add New Monitor
☛ In popup,Monitor Type
chooseHTTP(s)
☛ InFriendly Name
field, fill a monitor name you like ☛URL (or IP)
fill in your application URI ☛ ClickCreate Monitor
button.
It's possible to use Bitcoin to donate. Just send the Bitcoins to this address: 14ABxmCme8LPkKS2KuWU9YrQCHMVCcnTt5
Facebook Anonymous Publisher is licensed under the MPLv2 License.