예제 #1
0
  private void prepare(MediaWikiBot bot) {
    SimpleArticle a = new SimpleArticle();

    for (int i = 0; i < COUNT; i++) {
      a.setTitle(DELETE_PREFIX + i);
      a.setText(getRandom(23));
      bot.writeContent(a);
    }
  }
예제 #2
0
 public void push() {
   List<SyncStatus> toBeSync = commonDao.getList(SyncStatus.class, "synchronised", false);
   toBeSync.addAll(commonDao.getList(SyncStatus.class, "synchronised", null));
   for (SyncStatus status : toBeSync) {
     SimpleArticle article = new SimpleArticle(status.getArticleName());
     article.setText(status.getArticleContent());
     getBot().writeContent(article);
     status.setSynchronised(true);
     status.setSyncDate(new Date());
     commonDao.save(status);
     out.println("[Pushed] " + article.getTitle());
   }
 }