Jump to content

Recommended Posts

Posted

Morning everyone,

A quick question. Having come from WP which we were on prior to PW, we used to have the ability to have an automatic ping sent out to a variety of URLs to notify them when a new post is published. This is common behavior in WP and I was wondering if anyone has any ideas as to how to make this happen with PW.

This link explains the logic / how it works: http://codex.wordpress.org/Update_Services

An example url might be: http://rpc.pingomatic.com/

Thanks in advance,

Mike

Posted

Give this module (attached) a try. To install, upload into /site/modules/ServicePinger/ServicePinger.module. Go to your Modules menu and click "check for new modules". Click install for ServicePinger.

The module configuration screen has a textarea input where you can put in all the service URLs you want to ping. I recommend pinging one of the services that pings others, like pingomatic or weblogs.com, rather than trying to make this module do all of them.  Actually, those are the only two services I've tested this with yet. 

When you install, it creates a new field called "pinger". Go and edit any templates you want to use it on and add the field "pinger". In your case, I'm thinking you'll just add it to the "post" template. 

Now edit a page with that template and see the "pinger" field you added. If you want it to ping those services, check the pinger box and save. 

You might want to test this out on one of your smaller sites first before migrating to your main site, as I put this together quickly and haven't yet tested it a lot. But I'm planning to add a README file and maybe a couple other details and then add it to the modules directory soon.

ServicePinger.module

  • Like 9
Posted

Tried it out this morning and received the following error:

Recoverable Fatal Error:     Argument 2 passed to WireHttp::post() must be
of the type array, string given, called in
/home/critic/public_html/site/modules/ServicePinger.module on line 62
and defined (line 40 of /home/critic/public_html/wire/core/WireHttp.php)



This error message was shown because you are logged in as a Superuser. Error has been logged.
 
Posted

Mike– Looks like this module needs the dev branch (2.4). But I think we can get by with just updating your WireHttp.php class file. I went ahead and did that. Does it work now?

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
×
×
  • Create New...