Watches for your Facebook checkins and copies them to your WordPress blog. A form of automated PESOS. Similar to and inspired by OwnYourGram. More background.
This is not easy for the average user to set up. It would take a lot more work to make it a fully usable service like OwnYourGram. You can definitely get it up and running for yourself if you're not afraid to dive into technical details, though!
Uses Facebook's Real Time Updates and the WordPress.com REST API (available to self-hosted blogs via Jetpack).
This project is placed in the public domain. You may also use it under the CC0 license.
TODO: If the checkin includes a picture, this "attaches" it to the WordPress
post, which injects the <img>
tag for it above the post body. Change that so
it ends up below the post body.
-
Clone this repo.
-
Install the Jetpack plugin in your WordPress site, connect it to your WordPress.com account, and enable the JSON API feature.
-
Generate an OAuth token for your WordPress.com app and put it into a file called
wordpress.com_access_token
in the repo root dir. (Sadly, I haven't found a way to generate this token manually. I generated mine by running oauth-dropins locally and filling in my app's id and secret in thewordpress.com_client_id
andwordpress.com_client_secret
files.) -
Open the Graph API Explorer, select your app from the Application drop-down, and click Get App Token. Copy the token into a file called
facebook_app_token
in the repo root dir. -
Get a Facebook access token for your own user with the
offline_access
,read_stream
, anduser_photos
scopes and put it in a file calledfacebook_access_token
in the repo root dir.
If you have one lying around, for any app, great! I used mine from Bridgy. Otherwise, you'll have to generate one, and I haven't yet found a good manual/interactive way. (The Graph API Explorer doesn't let you ask foroffline_access
. :/) -
Create an App Engine app, replace
ownyourcheckin
inapp.yaml
with your app id, and deploy. -
Subscribe to Real Time Updates for your own Facebook posts with this command. Fill in APP_ID and ACCESS_TOKEN and replace
ownyourcheckin
with your App Engine app id.
curl https://graph.facebook.com/v2.2/APP_ID/subscriptions \
-d 'object=user&fields=feed&callback_url=https://ownyourcheckin.appspot.com/user_feed_update&verify_token=fluffernutter&access_token=ACCESS_TOKEN'
...and you're done! Post a checkin on Facebook, and it should automatically create a new post on your WordPress site.