Hi there, this is my second attemp at creating wordpress plugin. In this one, I create a plugin that will automatically send a short update to ping.fm for each time you hit the Publish button. To use it, you will need a ping.fm Application Key. This little plugin utilize PHPingFM API by Dmitri Gaskin.
To use it, first download the plugin and upload it to your /wp-content/plugins/. Enable it from your wordpress administration panel. Then, enter the Application Key in Settings » CR Post2Pingfm
That’s it, now, everytime you hit Publish, this little plugin will automatically post an update to ping.fm. But do remember, that once the post is published, it will never submit to ping.fm again and again. Because, you don’t want to annoy your follower right?
UPDATE:
- 2009-04-09 01:23:59: Download now handled by wordpress plugin repository
- 2009-06-11 15:27:30: Version 0.7 released with main feature is the ability to republish and setting another republish template






Works great, thank you
This is a great little plugin and I was so excited! However, I have installed this but when I publish the post, I get this error =(
Any ideas? Many thanks =)
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /nfs/c04/h03/mnt/66134/domains/blog.spudaroo.com/html/wp-content/plugins/cr-post2pingfm/PHPingFM.php on line 20
ARGH! Having same problem as Kate. Seems all Ping.fm apps require PHP5 (my host currently has PHP4, I cannot change this!).
It would have been really helpful to have known this ~before~ installing.
After complaining to my host, they told me that I *could* have PHP5 and switched me to a new server. YAY!
Although now I have a feature request. Could you please add an option to choose when to have it ping Ping.fm? (as in when posting new posts only, or just updates, or both?)
Thanks!
Great Plugin! Thank you.
Issue:
I’m looking into an issue where it seems that about 80% of the posts are making it to ping.fm .
I’m testing to see if this is happening due to publish scheduling and/or publishing from ‘press this’ although the ‘publish_post’ add_action should be hearing all of these events shouldn’t they?
Love the update, thanks so much!!
Hi,
I have installed the plugin without any errors. I publish a post and nothing happens–not even an error.
I waited 24 hours and still nothing has gone to ping.fm.
Any thoughts?
1. My Ping.fm API key is correct (double-checked)
2. PHP version: 5.2.9
3. Server: IIS 6.0
I’m getting absolutely nothing. Nothing is posting to my ping.fm account at all. with basically the same specs as the guy above.
Yea i am getting blank posts as well…
This plugin has stopped working for me in the last few days.
Hmm… is it because of the downtime twitter suffered few days ago? I should do some test.
The plugin completely stopped working for me since yesterday morning.
I changed hosting last week and at first it worked like a charm, much better than my previous host (I used to have to click ‘update’ 3 times before it’d get propagated). Now it completely stopped working and I’m not really sure why. I’ve done a test updating the post after enabling debugging but it’s not showing anything anywhere that I can see :/
Hey I got your plugin working on Wordpress MU 2.8.4 by modifying how options are used, following this guide: http://planetozh.com/blog/2009/05/handling-plugins-options-in-wordpress-28-with-register_setting/
You should update it! (took me all of 10 minutes)
It would be nice if you could post your code, Stefan
Well, here goes the changed cr-post-2-pingfm.php — for me, it works fine under WordPress MU 2.8.4, using these guidelines:
cat_ID;
$categories[] = $cats->category_nicename;
}
$continue = isCategoriesAllowedToPing($postId, $categories);
}
if($continue)
{
update_option('cr_post_2_pingfm_submit_post_submitted_'.$postId, true);
submitPingFM($postId, $republish);
}
}
}
function cr_post_2_pingfm_submit_config_admin()
{
add_options_page('CR Post2Pingfm', 'CR Post2Pingfm', 8, __FILE__, 'cr_post_2_pingfm_submit_config_form');
}
function cr_post_2_pingfm_submit_config_form() {
?>
CR Post2Pingfm
Ping.fm Application Key
<input type="text" size="45" name="cr_post_2_pingfm_options[cl_post_pingfm_api_key]" value="" />
Ping Template
<input type="text" size="45" name="cr_post_2_pingfm_options[cl_post_pingfm_message_template]" value="" />
Template Tags: {title} for Post Title and {url} for Permalink URL
eg: I just post {title} on {url}
Ping mode
Allow submit new post to ping.fm:
<input type="radio" name="cr_post_2_pingfm_options[cl_post_pingfm_ping_mode]" value="all" />For all categories (all)
<input type="radio" name="cr_post_2_pingfm_options[cl_post_pingfm_ping_mode]" value="allow" />For this categories (allow)
<input type="radio" name="cr_post_2_pingfm_options[cl_post_pingfm_ping_mode]" value="deny" />For categories except this one (deny)
Category list (category ID and slug is supported)<input type="text" name="cr_post_2_pingfm_options[cl_post_pingfm_ping_mode_category]" value="" />(comma separated, eg: 1,23,random-caregory,10,rants)
Category list is ignored if mode all is selected.
Publish mode
Allow submit to ping.fm on the following condition:
<input type="radio" name="cr_post_2_pingfm_options[cl_post_pingfm_publish_mode]" value="once" />Only submit for the first time(once)
<input type="radio" name="cr_post_2_pingfm_options[cl_post_pingfm_publish_mode]" value="all" />For everytime you push publish button(all)
Re-Publish template
This option only used if you choose all in publish mode.
<input type="radio" name="cr_post_2_pingfm_options[cl_post_pingfm_republish_template]" value="above" />Use Ping Template above
<input type="radio" name="cr_post_2_pingfm_options[cl_post_pingfm_republish_template]" value="this" />Use this template
<input type="text" size="45" name="cr_post_2_pingfm_options[cl_post_pingfm_ping_republish_template_text]" value="" />
The above template tags, apply.
<input type="submit" class="button-primary" value="" />
$post->post_title,
'{url}' => get_permalink($postId),
);
foreach($arrTemplate as $template => $template_data)
{
$ping_template = str_replace($template, $template_data, $ping_template);
}
$result = $pfm->post("status", $ping_template);
}
function isCategoriesAllowedToPing($postId, $categories)
{
$pingMode = get_option('cl_post_pingfm_ping_mode');
$pingCats = get_option('cl_post_pingfm_ping_mode_category');
$pingCats = array_map("trim", explode(",", $pingCats));
if(!is_array($pingCats)) $pingCats = array();
if("allow" == $pingMode)
{
foreach($categories as $cats)
{
if(in_array($cats, $pingCats))
{
return true;
}
}
}
else if("deny" == $pingMode)
{
foreach($categories as $cats)
{
if(in_array($cats, $pingCats))
{
return false;
}
}
return true;
}
else
{
return true;
}
}
How can I post an excerpt of blogpost when submitting to Ping? I’d like to still use {title} on {url} in addition. Any help would be appreciated.
Can you be more specific?
Some example maybe? so that I can get your idea.
Marcus Cudd noticed that this tweak of mine wasn’t working properly. Since I have problems posting code here, I’ve added it to my own blog. The fix was in the way options are read on WordPress MU.
Here is the tweaked code for the plugin. Please test it and see if it works well for you
Awesome work! But, sorry, I can’t confirm it, I don’t have wp-mu installed.
For now, whenever people need it to work on wp-mu, I’ll direct it to your post. Because, based on recent blog post on wordpress.org, they intended to integrate wp & wp-mu on single source.
Is this working with the latest version of wordpress ? (2.91)
Hi,
I’ll try to test in tonight on my 2.9.1 installation. I’ll report it back soon.
Confirmed. My plugin worked on wp 2.9.1.
I just test it on this blog.
Sorry to say this, but I think your plug-in stopped working after the upgrade.
I use this on several sites and upgraded each one and they stopped working.
Are you sure?
Because, I too used it on several sites and there’s no problem after upgrading.