dimitrios

AutoFbPost

Recommended Posts

Hello,

I have created a module that, given a Facebook app ID and secret, posts on Facebook on behalf of a user profile or page after a PW page is saved.

This module is configurable as follows:

  • Templates: posts can take place only for pages with the defined templates
  • On/Off switch: specify a checkbox field that will not allow the post if checked
  • Specify a message and/or an image for the post

post-4087-0-60791400-1457660876_thumb.jp

Usage

edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, a token is kept.

 
post-4087-0-78890000-1457661715_thumb.jp
 

Note: Facebook SDK for PHP is used.

post-4087-0-60791400-1457660876_thumb.jp

post-4087-0-78890000-1457661715_thumb.jp

Edited by dimitrios
updated module
  • Like 15

Share this post


Link to post
Share on other sites

Hello netcarver,
 

you are absolutely right, I just updated my post. I have submitted the module and it is currently pending approval. Thank you!

  • Like 3

Share this post


Link to post
Share on other sites

I use PW3 and I always get this error message if I try to login in backend after uploading the module to the server:

post-2257-0-21694000-1458315891_thumb.jp

Is this module not compatible with the latest PW version?

Best regards Jürgen

Share this post


Link to post
Share on other sites

Hello Juergen,

I am sorry for such a late answer. You are right, this is not needed since PW manages the session.
I will try to test this module with various PW versions and update it. Thank you for your post!

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

seems this is written for php 5.4... I'm not on that yet :-)

Would you consider making it < 5.4 compatible?

regards

Share this post


Link to post
Share on other sites

Hey,

First off, thanks for this great module.

I was just wondering where the On/off checkbox is meant to show as every time I save the page at the moment it gets posted to Facebook and I'd rather have it that you check that checkbox and it stops posting to facebook?

Thanks!

 

Share this post


Link to post
Share on other sites
42 minutes ago, alexmercenary said:

where the On/off checkbox is meant to show

You need to create a new checkbox field, give it a name like autofbpost and add the field to your template. Next configure the module: in the inputfield On/Off Checkbox, enter the name of the field you created.

 

Share this post


Link to post
Share on other sites

cant seem to get it working with facebook. keeps giving me this error:

AutoFbPost: post failed; click here to log in with Facebook.

URL blocked: This redirect failed because the redirect URI is not white-listed in the app's client OAuth settings. Make sure that the client and web OAuth logins are on and add all your app domains as valid OAuth redirect URIs.

my settings: https://www.dropbox.com/s/y4ajeac4wwlyup4/Screenshot 2017-07-07 16.53.23.png?dl=0

and platform the website url.

any help would be appreciated

Share this post


Link to post
Share on other sites

This module seems not compatible with the latest Facebook policy. If you want to post something through a Facebook app, you need to apply for the permission. Otherwise, it ask for login every time just as your case.

Gideon

Share this post


Link to post
Share on other sites

@videokid yeah I do have opengraph in the header but it isn't detecting the image field, it's just using the site logo as the post image and the default site description as the description. It's weird.

Share this post


Link to post
Share on other sites

I do: https://www.featherbow.co.uk/gallery/cherington-open-plan-kitchen/

By the way thanks for the help on this.

I'm using MarkupSEO which is auto detecting the image field as it turns out so I don't actually need to add anything into the AutoFbPost field for image field name etc. Although I have anyway. The default 'images' field.

Thank you for your time

Share this post


Link to post
Share on other sites

Well I don't see anything wrong....
But it is your default description indeed [MarkupSEO isn't picking up body/description field?].

Personally I'm not using MarkupSEO, I have everything in my _init.php configured and, so far at least, it is working....
It's a pretty old website, still running pw 2.7.1/2..... Haven't tried it on pw 3.x yet, but I guess this has nothing to with pw...

I had a strange experience once where FB wasn't picking up any opengraph whatsoever, and I actually had to create a facebook app id for that site, but so far I've encountered it only once.... that was very weird too.... 

Sorry I can't be more informative....

  • Like 1

Share this post


Link to post
Share on other sites

Weirdly it's working now... Or at least the image is loading the correct one.

I have just cleared the default meta description from the MarkupSEO module settings and added directly to the homepage and then used the body as the smart description so it is used for open graph description and meta description for all other pages and that isn't showing the correct description yet when being posted but perhaps Facebook caches the results for a while?
 

Either way you have been a BIG help and I can't thank you enough for taking the time to take a look with me!

Thank you @videokid

  • Like 1

Share this post


Link to post
Share on other sites

Hello,

this module has been updated and it is now compatible with Graph API version 2.10.

Parameters 'description' and 'name' are not supported by the new Graph API version. Therefore, fields for description and name cannot be provided anymore.

  • Like 4

Share this post


Link to post
Share on other sites

Hi,

I have problems to connect the module to FB app, I get the error mentioned by benbyf her above: AutoFbPost: post failed; click here to log in with Facebook. Then the error message says: "App not configured. This App is still in development mode and you can't access it"...

Is there anything else I need to set in facebook? I've tried all possible configuration and I don't know where to check now. Screenshot attached. Thanks a lot for any help.

 

fb.png

fb1.png

fb2.png

fb3.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By flydev
      PulsewayPush
      Send "push" from ProcessWire to Pulseway.
       
      Description
      PulsewayPush simply send a push to a Pulseway instance. If you are using this module, you probably installed Pulseway on your mobile device: you will receive notification on your mobile.
      To get more information about Pulseway, please visit their website.
      Note
      They have a free plan which include 10 notifications (push) each day.
       
      Usage
      Install the PulsewayPush module.
      Then call the module where you like in your module/template code :
      <?php $modules->get("PulsewayPush")->push("The title", "The notification message.", "elevated"); ?>  
      Hookable function
      ___push() ___notify() (the two function do the same thing)
       
      Download
      Github:  https://github.com/flydev-fr/PulsewayPush Modules Directory: https://modules.processwire.com/modules/pulseway-push/  
      Examples of use case
      I needed for our work a system which send notification to mobile device in case of a client request immediate support. Pulseway was choosen because it is already used to monitor our infrastructure.
      An idea, you could use the free plan to monitor your blog or website regarding the number of failed logins attempts (hooking Login/Register?), the automated tool then block the attacker's IP with firewall rules and send you a notification.
       

       
      - - - - - - - - - - - - - -
      11-22-2017: added the module to the modules directory
       
    • By netcarver
      Part 1 of a 2 part Module & Service Reveal.
      I'm currently working on a new module: ModuleReleaseNotes that was inspired by the work I originally did on making Ryan's ProcessWireUpgrades module "release" aware. In the end, I decided to ditch the approach I was originally taking and instead work on a module that hooked in to the UpgradeConfirmation dialog and the module edit page.
      Aims
      My aims for this module are as follows...
      Make discovery of a module's changes prior to an upgrade a trivial task. Make breaking changes very obvious. Make reading of a module's support documentation post-install a trivial task. Make module authors start to think about how they can improve the change discovery process for their modules. Make sure the display of information from the module support files/commit messages doesn't introduce a vulnerability. Looking at these in turn...
      Making discovery of a module's changes prior to upgrade a trivial task.
      This is done by adding a "What's changed section" to the upgrade confirmation dialog.  This section takes a best-effort approach to showing what's changed between the installed version and the updated version that's available via the module repository.
      At present, it is only able to talk to github-hosted repositories in order to ask them for the release notes, the changelog file (if present) and a list of commits between the git tag that matches the installed version and the tag matching the latest version.
      It will display the Release Notes (if the author is using the feature), else it will display the commits between the tags (if tagging is used by the module author) else it will show the changelog file (if present) else it will show the latest N commits on the master branch (N, of course, being configurable to your liking.)
      An example of the Github Release Notes pulled in for you, taken from Mike Rockett's TextformatterTypographer Module...

      An example of a tag-to-tag commit list from the same module...

      An example of a changelog - formatted to show just the changes (formatting styles will change)...

      Finally, an example of a fallback list of commits - sorry Adrian ...

       
      Making breaking changes obvious.
      This is currently done by searching for a set of configurable search strings. Later versions may be able to support breaking change detection via use of Semantic Versioning - but this may require some way of signalling the use of this versioning standard on a module-by-module basis.
      For now, then, you can customise the default set of change markers. Here I have added my own alias to the list of breaking change markers and the changes section of the changelog is styled accordingly (these will be improved)...

       
      Make reading of a module's support documentation, post-install, a trivial task.
      This is done by making some of the support files (like the README, CHANGELOG and LICENSE files) readable from the module's information/settings screen. There is an option to control the initial open/closed state of this section...

      Here is Tracy's README file from within the module settings page... 

       
      Make module authors start to think about how they can improve the change discovery process for their modules.
      There are notes in each of the sections displayed on the upgrade confirmation page that help authors use each of the features...

       
      Make sure display of external information doesn't introduce a vulnerability.
      This is an ongoing concern, and is the thing that is most likely to delay or prevent this module's release lead to this module's withdrawl should a vulnerability be found. Currently, output is formatted either via Markdown + HTML Purifier (if it was originally a Markdown file) or via htmlspecialchars() if it has come from a plaintext file.
      If you discover a vulnerability, please get in contact with me via the forum PM system.
       
      Ongoing...
      For now, I've concentrated on integration with GitHub, as most people use that platform to host their code. I know a few people are hosting their repositories with BitBucket (PWFoo comes to mind) and some with GitLab (Mike Rockett?) and I would eventually like to have adaptor implementations for these providers (and perhaps GitKraken) - but for now, GitHub rules and the other hosts are unsupported.
       
      Links
      Github: ModuleReleaseNotes
      PW Module Repository: Here
    • By FrancisChung
      Hi,
      I was wondering if anyone knew what this did? 

      If so, do you know what modules it actually impacts? Is there another log that lists the action it took?

      I'm having some weird problems with PHP duplicate declaration per link below, since this module was run.
       
       
    • By tpr
      AdminOnSteroids
      Various admin tweaks to enhance ProcessWire admin.
      http://modules.processwire.com/modules/admin-on-steroids/
      https://github.com/rolandtoth/AdminOnSteroids