We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16885
    • 255 Posts
    I do understand MODx is more aimed at developers than at ’bloggers’, but I’ve been trying to get this working for quite a while now by using these GPL’d methods for XML-RPC pings, and somehow I can’t get it to work correctly.
    What this does is basically sending out a ping to a list of sites that monitor weblogs for new posts, in order to let them re-spider your content, that way you can get your new blogentries showing up on i.e. Technorati within a day. Sadly I’m lacking the know-how to get this fixed and working myself, so I’m hoping there are others out here who are interested in this as well wink
      • 16885
      • 255 Posts
      Bump, still hoping anyone is interested in looking into this, might be a really welcome add on for those who’d like to blog with MODx.
        • 16732
        • 592 Posts
        Hi here a fast made plugin to test who use the weblog_pinger class.

        I did not test it so tell me if it works wink

        I use the ’OnDocPublished’ event.

        For the moment the plugin only ping technorati.com site.

        If the plugin seems to works let me know, and I will extend the plugin with the others sites.
          • 16885
          • 255 Posts
          I’ve installed it and ran it the first time now (after publishing a new newsarticle), it’ll take upto an hour for Technorati to respider my blog, so I’ll post back later. No errors were returned so it seems ’ok’.

          Edit, no update yet so far.
          I looked at the code and noticed this;
          $e = &$modx->Event;
          switch ($e->name) {
                  case "OnDocPublished":

          Isn’t that double; you’re already setting the configuration of the plugin to OnDocPublished, wouldn’t that be enough?

          Edit2; it updated! After I republished one of my blog entries by using the manager Technorati seems to have spidered my website again, a little odd though, why didn’t it spider after I used the Newspublisher? Laurentc, you’re my hero wink
            • 7923
            • 4,213 Posts
            Not sure if NewsPublisher calls the OnDocPublished event when it publishes a document

            EDIT: So you’d need to add $modx->invokeEvent("OnDocPublished"); to the snippet where it publishes a document


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 16732
              • 592 Posts
              I’m glad that the plugin works !! grin

              I wasn’t sure of the event to use... I’m not so familiar with the event notion...

              @doze: thanks to mention the use of $modx->invokeEvent("OnDocPublished");

              Do a tutorial or a post exist on this subject ?

                • 16885
                • 255 Posts
                Quote from: laurentc at Dec 30, 2006, 05:04 AM

                I’m glad that the plugin works !! grin

                I wasn’t sure of the event to use... I’m not so familiar with the event notion...

                @doze: thanks to mention the use of $modx->invokeEvent("OnDocPublished");

                Do a tutorial or a post exist on this subject ?
                I’ve only found this ’documentation’ of it so far, the search isn’t too helpful and I didn’t find any examples yet, but it seems kind of straightforward.

                Addition;
                I’ve edited my ’NewsPublisher(Tagging)’ snippet by adding
                            $modx->invokeEvent("OnDocPublished");
                right after
                             // redirect to post id
                            $modx->sendRedirect($modx->makeUrl($postid));

                It didn’t generate any errors, all what’s left now is waiting to see if it worked. Sadly the logging of the ping class doesn’t seem to work, even though I’m pretty sure I’ve configured it correctly.
                No errors, but no results either, looks like I did *something* wrong...
                  • 7923
                  • 4,213 Posts
                  In the snippet, try:

                  $modx->invokeEvent("OnDocPublished",array("docid"=>$lastInsertId));

                  and put it before the redirecting.. ..and no, I’m not very familiar with the event invoking either and don’t remember any posts about it, but I think it should work something like this..


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 16885
                    • 255 Posts
                    Quote from: doze at Dec 30, 2006, 10:40 AM

                    In the snippet, try:

                    $modx->invokeEvent("OnDocPublished",array("docid"=>$lastInsertId));

                    and put it before the redirecting.. ..and no, I’m not very familiar with the event invoking either and don’t remember any posts about it, but I think it should work something like this..
                    That solved it, the code is really executed now, I’ve got a brand new error now though, concerning the plugin code,
                    « MODx Parse Error »
                    MODx encountered the following error while attempting to parse the requested resource:
                    « PHP Parse Error »
                     
                    PHP error debug
                      Error: 	fsockopen() [function.fsockopen]: unable to connect to rpc.technorati.com:80 (Connection timed out)	 
                      Error type/ Nr.: 	Warning - 2	 
                      File: 	/chroot/home/user/domain/html/assets/plugins/weblogpinger/xmlrpc.inc	 
                      Line: 	1304	 
                      Line 1304 source: 	$fp=@fsockopen($connectserver, $connectport, $this->errno, $this->errstr); 	 
                     
                    Parser timing
                      MySQL: 	0.1009 s	(22 Requests)
                      PHP: 	45.4746 s	 
                      Total: 	45.5755 s	 

                    I’m kinda clueless on how to stop that from happening, it seems to happen quite often (Technorati must be busy I guess).
                      • 25663 MODX Staff
                      • 12,272 Posts
                      I think they’re having problems right now. Connection is failing from pingoat.com too.
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me