Multi-ping in Movable Type

How to ping both weblogs.com and blo.gs when you publish from Movable Type (note that I’m assuming that you installed Movable Type in a directory named /mt/):

  • Edit /mt/lib/MT/App/CMS.pm
  • Find the line that reads $app->ping(Blog => $blog) or die $app->errstr;
  • Insert a new line immediately after that, that reads:
    MT::XMLRPC->ping_update('weblogUpdates.ping', $blog, 'http://ping.blo.gs') or die MT::XMLRPC->errstr;
  • Save, reupload, publish a new post, and check blo.gs and weblogs.com.

Note that while this method worked for me, it didn’t work for Shannon. The alternate method that worked for her:

  • Edit /mt/lib/MT.pm
  • Find the line in sub ping that reads MT::XMLRPC->weblogs_ping($blog) or return $mt->error(MT::XMLRPC->errstr); (displayed on two lines, but it’s one line of code)
  • Insert a new line immediately after that, that reads: MT::XMLRPC->ping_update('weblogUpdates.ping', $blog, 'http://ping.blo.gs/') or return $mt->error(MT::XMLRPC->errstr);

31 Comments

Comment by gillo #
2002-06-20 03:30:58

No luck…. I tried both and, while the first gave me an error in the pop-up window after I added a new entry (the second didn’t), although they both add the entry to the weblog, none seems to successfully ping blo.gs or weblog.com.

Any idea? I’m using MT 2.1 and you hack would be really useful.

 
Comment by Phil Ringnalda #
2002-06-20 07:27:13

Are you successfully pinging weblogs.com without the hack?

 
Comment by gillo #
2002-06-20 08:38:43

yep also blo.gs

 
Comment by Phil Ringnalda #
2002-06-20 09:26:35

Hmm. I think I’m asking the wrong questions, but I’m not sure what the right question is.

You say that neither form of my hack successfully pings weblogs.com? Since they both come after the weblogs.com ping should have succeeded, neither one should affect it. Are you allowing enough time after your last ping, before you test the hacks? Both weblogs.com and blo.gs only accept one ping every 5 or 15 minutes (I forget which, right now), and although weblogs.com doesn’t return an error when you ping too often, blo.gs does (that’s why I did my stop spam pinging hack to not ping every time an entry was edited). So maybe your error was coming from that, rather than the ping failing? What was the actual error? It’s been long enough now that I don’t remember, does MT give you an error message that tells you what sort of error blo.gs returns, or just that there was an error?

 
Comment by gillo #
2002-06-20 13:45:01

Ok, now, few hours since my last post, I entered another entry, using the second hack. I will not manually ping weblogs.com or blo.gs and I’ll check again in 20 mins. If it’s still not there then maybe I’ll try the first again and let you know what’s the error.

 
Comment by gillo #
2002-06-20 15:04:14

Nothing… the second method didn’t give me any error but it didn’t ping anything (you can check both sites) the first instead, as it happened before, allowed me to post the bug, but the ”confirmed post” page on the pop-up gives me this error:

”Your post was saved, but the rebuild or ping failed: Can’t locate object method ”ping_update” via package ”MT::XMLRPC” at /home/gillo/cgi-bin/mv/lib/MT/App/CMS.pm line 1418.”

I’m wondering if it has something to do with the server…

 
Comment by Phil Ringnalda #
2002-06-20 15:34:35

Hmm. Or maybe the file. Do you have (assuming MT is installed in a directory named mt) /mt/lib/MT/XMLRPC.pm and does it look OK and have ”sub ping_update” in it?

 
Comment by gillo #
2002-06-21 14:57:56

well MT is installed in a mv dir so the file is at cgi-bin/mv/lib/MT/XMLRPC.pm but, yes, there it is. It also has ”sub ping_update” but I don’t know what you mean by ”does it look ok?”

Maybe it’s the heat :-)

 
Comment by Phil Ringnalda #
2002-06-21 18:50:18

Or the humidity. It’s starting to confuse me (thus missing that you just told me that your install was in /cgi-bin/mv).

Does your server have LWP::UserAgent installed? That’s the optional Perl module about which mt-check.cgi would have said ”LWP::UserAgent is optional; it is needed if you wish to use either the weblogs.com ping or the MT Recently Updated ping.” when you were first installing MT. That’s my best guess at this point: without LWP::UserAgent, the ping fails silently except with my hack in CMS.pm, when it throws that error message. Maybe.

 
Comment by gillo #
2002-06-22 04:23:01

I think I installed it (it was a while ago) any way to check?

 
Comment by Phil Ringnalda #
2002-06-22 07:50:25

Yeah, run /cgi-bin/mv/mt-check.cgi again and see. Which I just did, and you do have it, so there goes that theory. Um. Did you say that MT was successfully pinging weblogs.com automatically without my hack?

 
Comment by gillo #
2002-06-22 13:56:14

yep, also blo.gs.

 
Comment by Phil Ringnalda #
2002-06-26 22:21:02

Updated for 2.2:

In MT.pm, just before the final } of:

    if ($blog->ping_weblogs) {
        require MT::XMLRPC;
        if (MT::XMLRPC->weblogs_ping($blog)) {
            push @res, { good => 1, url => $mt->{cfg}->WeblogsPingURL,
                         type => "update" };
        } else {
            push @res, { good => 0, url => $mt->{cfg}->WeblogsPingURL,
                         type => "update", error => MT::XMLRPC->errstr };
        }
    }

add a new section that reads:

        if (MT::XMLRPC->ping_update('weblogUpdates.ping', $blog, 'http://ping.blo.gs/')) {
            push @res, { good => 1, url => 'http://ping.blo.gs/',
                         type => "update" };
        } else {
            push @res, { good => 0, url => 'http://ping.blo.gs/',
                         type => "update", error => MT::XMLRPC->errstr };
        }

so that the whole section (down to just above ”if ($blog->mt_update_key)”) reads:

    if ($blog->ping_weblogs) {
        require MT::XMLRPC;
        if (MT::XMLRPC->weblogs_ping($blog)) {
            push @res, { good => 1, url => $mt->{cfg}->WeblogsPingURL,
                         type => "update" };
        } else {
            push @res, { good => 0, url => $mt->{cfg}->WeblogsPingURL,
                         type => "update", error => MT::XMLRPC->errstr };
        }
        if (MT::XMLRPC->ping_update('weblogUpdates.ping', $blog, 'http://ping.blo.gs/')) {
            push @res, { good => 1, url => 'http://ping.blo.gs/',
                         type => "update" };
        } else {
            push @res, { good => 0, url => 'http://ping.blo.gs/',
                         type => "update", error => MT::XMLRPC->errstr };
        }
    }
 
Comment by Greg Leffler #
2002-07-06 15:14:58

Works like a charm! Great job, and thanks!

 
Comment by yAz #
2002-07-08 05:46:08

This isn’t a question about the multi-ping hack, but how can I get the referrals list into the site like how you have it on this page?

 
Comment by Phil Ringnalda #
2002-07-08 20:10:24

Sometime I should do a script to map all the weird interconnections among my comments. There’s a link to a sort of development snapshot of the referrals script over here, in also unrelated comments, but as I say there, it’s really ugly code, thrown together in a hurry to see if I’d like it, and then never redone.

 
Comment by Chris Collins #
2002-07-12 14:46:27

You’re the best! It worked for me on the first try.

 
Comment by red_one #
2002-08-08 08:40:44

With the original patch, I get:
”Your post was saved, but the rebuild or ping failed: HTTP error: 500 read timeout”

 
Comment by andersja #
2002-08-19 12:49:46

Just curious – does the latest ”patch” above also work with 2.21? Thanks!

 
Comment by Phil Ringnalda #
2002-08-19 18:49:57

The 2.2 version in the comment? Sure does.

 
Comment by Ragnar #
2002-09-02 06:04:56

Hi, I would like to know how the referral list gets created? Does MT offer the option of tracking referring urls? Thanks!

 
Comment by Phil Ringnalda #
2002-09-02 19:19:04

Nope. See the link from a few comments back, to where it’s discussed in another set of comments.

 
Comment by Kymberlie R. McGuire #
2002-09-08 00:55:33

I think it’s working for me, but occasionally I get this message:

Ping error: Weblog already updated recently.

Any idea what might be causing it or how to fix it? I’m on MT 2.21. Thanks!

 
Comment by Phil Ringnalda #
2002-09-08 19:09:40

You should only get that when you’ve already pinged in the last n (I think five, not sure) minutes. For whatever reason, weblogs.com doesn’t return it as an error, so MT doesn’t tell you about it, but blo.gs does return an error, so when you ping them you do see it as an error.

What can you do about it? Just ignore it until MT 2.5 comes out: it’s going to only ping when you first save a post (2.2x and older ping every time you save a post, even if you are just correcting a typo), so unless you are posting in full-on firehose mode, you probably won’t see it again.

 
Comment by Phil Ringnalda #
2002-10-08 22:06:22

Updated for MT 2.5 : no need to hack, just go to Blog Config -> Preferences -> Publicity, and check the box to ping blo.gs.

 
Comment by Lyrae #
2002-12-31 21:59:05

This might sound stupid, but I have 2.5 installed and there’s no option to ping blo.gs where you’ve specified.

How is that possible?

 
Comment by Phil Ringnalda #
2002-12-31 22:23:45

Only way I know of to do that is to fail to upgrade one of the .tmpl files in {your MT directory}/tmpl/cms/, probably cfg_prefs.tmpl, while upgrading.

 
Trackback by Among Other Things #
2002-08-01 19:12:11

Testing, 1, 2, 3

Just hacked in Phil Ringnalda’s hack to ping blo.gs along with weblogs.com. This is a test to see if it

 
Trackback by andersja's blog #
2002-08-21 12:12:01

Pinging blo.gs

Just a short notice: This blog now also pings blo.gs when updated. How? Using Phil Ringnalda’s Multi-ping in Movable Type-hack.

 
Trackback by scriptygoddess.com #
2002-09-07 20:17:56

Pings for Everyone!

While this isn’t new, it’s new to me – so I wanted post it here so everyone could use it.

 
Trackback by Neurotic Fishbowl #
2002-09-08 00:28:35

Pinging blo.gs With MT

I had read how to ping blo.gs at the same time that you ping Weblogs.com with MT quite some time

 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <del datetime="" cite=""> <dd> <dl> <dt> <em> <i> <ins datetime="" cite=""> <kbd> <li> <ol> <p> <pre> <q cite=""> <samp> <strong> <sub> <sup> <ul> in your comment.