WordPress robot updated

I have updated the WordPress robot (WP-BOT@appspot.com) to publish to your own blog. This feature has been requested by many users, so I thought it was time to give it a try. The usage of the robot is fairly simple. The original version of the robot was described in this post, where I just proved the concept was possible.

Simply add the robot to a Wave. You don’t have any credentials connected with your Wave your you will get a link, where you can enter information about your WordPress. Next time you add the robot to a wave, the new Wave will be published to a new Wave.

To use the plugin simply add Wavr to your blog and in Setting -> Writing Settings make sure XML-RPC is activate.

The usage is also showed on this video.

Do you have any suggestion on how I can make the service even better?

Bookmark and Share

WordPress publisher bot

Inspired by offlineblog’s blog about Live blogging and the WordPress plugins like described on my blog, and at offlineblog and the bloggy robot which can publish to blogger.com. I thought this could also be possible to perform the same with a WordPress robot.

The solution simply works by adding the robot wp-bot@appspot.com to a Wave. Then it publishes your wave to the site as an embedded wave to WordPress. With this you get a permalink to the blog, where the content is hosted. I was unable to using the API’s that Google is using for displaying that the content is shared. If you know how to use please let me know.

I found the wordpress-java library to help with creating the XMLRPC code, which I was unable to use. With this library it is pretty simple to create a blog with some content. And since the content I’m posting just is wave id=’waveID’ bgcolor=’#ffffff’, it is pretty easy to craft.

The robot in action works the following way.

 

The code looks like the following.

public class WPRobotServlet extends AbstractRobotServlet {
      private String ownname = "wp-bot@appspot.com";
 
    @Override
    public void processEvents(RobotMessageBundle bundle) {
        Wavelet wavelet = bundle.getWavelet();
       
        // when the Robot is added publish to the robot
        if (bundle.wasSelfAdded()) {

            Blip blip = wavelet.appendBlip();
            TextView textView = blip.getDocument();
            textView.append(ownname+ " added version " +this.getVersion() +" \n");
            textView.appendMarkup("\n <a href=\"http://masteringwave.com/\">MasteringWave</a> <br />");
            textView.append("\n");
            String rootText = wavelet.getRootBlip().getDocument().getText();
            // find the first line, which will be the title to the blog
            String firstLine ;
            if(rootText.indexOf("\n")>0){
                firstLine =     rootText.substring(0,rootText.indexOf("\n"));
            }else{
                firstLine = rootText;
            }
            textView.append( uploadWave(firstLine, wavelet.getWaveId()));
        }
         

    }
   
    private String uploadWave(String title, String waveID){
           String sXmlRpcURL = "http://wp-bot.masteringwave.com/xmlrpc.php";
              String sUsername = "wave";
              String sPassword = "<SECRET>";
         
              // Hard-coded blog_ID
              String blog_ID = "1";

              // XML-RPC method
              String sXmlRpcMethod = "metaWeblog.newPost";
              // the content of the blog
              String sContent = "[wave id=\""+waveID+"\" bgcolor=\"#ffffff\"]";

                  // Try block to create the upload
              try
              {
                Wordpress wp = new Wordpress(sUsername, sPassword, sXmlRpcURL);
                  Page newPost = new Page();
                  newPost.setTitle(title);
                  newPost.setDescription(sContent);
                  newPost.setWp_author(sUsername);
                  String resultId = wp.newPost(newPost, "draft");
                  return wp.getPost(Integer.parseInt(resultId)).getPermaLink();
              }
              catch( Exception e )
              {
               return e.toString();
              }
    }
}

 

The full code can be found at http://code.google.com/p/masteringwave/source/browse/#svn/trunk/WP-BOT.

If you just want to check it out, just add the robot wp-bot@appspot.com to your Wave and the wave will be published.

Bookmark and Share

An example where Google Wave is the right tool

I was talking to a friend yesterday. He is a PR person working in a political environment.

One of his tasks was to make a brochure with a description of a large venue. The venue is a collaboration between multiply political organizations in the area.

His first task was to clear his draft with his own organization. This took some time to write and find the right voice and communication. Then he had to clear the content with the other organizations. When one of the organizations got their homepage on the brochure, all the others also wanted to have their homepage on as well.

To make matters worse the brochure had to go through a graphical person, so the result of the revisions was displayed like the will be in the final brochure.

If could use Google Wave for the process. He could a have created a Wave with his proposed content. When the content was cleared in his organization, he could create a new wave with the result. The new wave could then be shared with the other organizations, and they could agree on the text. They could see what each other wanted to correct and comment on these changes.

It will not be possible to use have the graphical layout created in the Wave. But if everybody is sure about the content, then it would only be the graphical layout which needed to be discussed. If wave also was used for this, then it would be easier to agree on the changed that was required.

So if my friend and his organization were able to use Google Wave they could collaborate easier and probably also save some meetings.

 

 

Bookmark and Share