Package net.bican.wordpress

Examples of net.bican.wordpress.Wordpress


  public static void main(String[] args) throws MalformedURLException,
      XmlRpcFault {
    String username = args[0];
    String password = args[1];
    String xmlRpcUrl = args[2];
    Wordpress wp = new Wordpress(username, password, xmlRpcUrl);
    List<Page> recentPosts = wp.getRecentPosts(10);
    System.out.println("Here are the ten recent posts:");
    for (Page page : recentPosts) {
      System.out.println(page.getPostid() + ":" + page.getTitle());
    }
    List<PageDefinition> pages = wp.getPageList();
    System.out.println("Here are the pages:");
    for (PageDefinition pageDefinition : pages) {
      System.out.println(pageDefinition.getPage_title());
    }
    System.out.println("Posting a test (draft) page from a previous page...");
    Page recentPost = wp.getRecentPosts(1).get(0);
    recentPost.setTitle("Test Page");
    recentPost.setDescription("Test description");
    String result = wp.newPost(recentPost, false);
    System.out.println("new post page id: " + result);
    System.out.println("\nThat's all for now.");
  }
View Full Code Here

TOP

Related Classes of net.bican.wordpress.Wordpress

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.