WaveCalendar 24: Publish to WordPress

For this last post I was looking for a gadget or robot that had some Christmas sense. In the Wave Samples Gallery I was unable to find a christmas tree gadget or anything in that order. I therefore would like to write a little about the last robot that I made. The wordpress bot, that you can install on your own appengine instance. This robot was initial tied up with my test blog site and only that.

In November the next version of the robot was released. This time the wordpress robot could publish to your own blog. It made it much easier for people to publish waves to their blog. A change was also made in the embed api by Google, so it was not possible to change the root blip.  This makes the publishing much easier, then it just miss the option of viewing the wave without a Wave account. I can see that the robot wp-bot@appspot.com has published to 122 different blogs, so it is something that people are using.

You can see the demo of the robot hire.

I’m hoping to get some more time in the next year to improve some of the features of the robot.

I hope you have enjoyed reading this calender and have found some new useful gadgets, which you can use in your daily life with Wave. If you have any ideas for gadget you think we should have a look at please drop a comment or a wave.

Bookmark and Share

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

WordPress plugin to embed waves

Yesterday I wrote about Wavr plugin to WordPress. This blog was liked to from a number of posts. Offlineblog has a log description on how the plugin functions. Mashable wrote about the applications of the plugin and embedding waves in different media. The last 3 links was exact copies of the Mashable article.

I must admit, I did not do a very good job in research. There is also the plugin wp-wave-shortcodes which does the same. I’m not able to try the plugin on since, they both uses the same codes.

I doubt there is a large difference in the two plugins work at the moment. It is very limited what the Embed API supports at the moment. What will be interesting will be to see how the two plugins will develop with the next release of the Embed API.

I’m sure that I get back to the subject on the WordPress plugins later, where more functions are published. I’m looking forward to include the Waves as comment section or making it work on other ways.

Bookmark and Share

Wavr a Google Wave plugin to wordpress

Yesterday I found the Wavr by Lucas Caro, a plugin which allows the user to add waves as embedded to the waves.

You just insert the code

[wave id="wave-id"]

and then you have the wave embedded in your post. Like showed bellow. The plugin requires the user to have a Wavesandbox account to see the waves, but then they can interact with the page directly. If not they just get an unauthorized page.

[wave id=”wavesandbox.com!w+ywmqSkT9%8″ bgcolor=”#ffffff”]

The plugin still have some more development, but it shows how easy it is to reuse conversation on ie blogs or Wikis.

 

Bookmark and Share