Package info.bliki.api

Examples of info.bliki.api.User


  }

  public static void testWikipediaENAPI(String title) {
    String[] listOfTitleStrings = { title };
    String titleURL = Encoder.encodeTitleLocalUrl(title);
    User user = new User("", "", "http://en.wikipedia.org/w/api.php");
    user.login();
    String mainDirectory = "c:/temp/";
    // the following subdirectory should not exist if you would like to create a
    // new database
    String databaseSubdirectory = "WikiDB";
    // the following directory must exist for image downloads
View Full Code Here


  }

  public static void testWikipediaENAPI(String title, String apiLink) {
    String[] listOfTitleStrings = { title };
    String titleURL = Encoder.encodeTitleLocalUrl(title);
    User user = new User("", "", apiLink);
    user.login();
    String mainDirectory = "c:/temp/";
    // the following subdirectory should not exist if you would like to create a
    // new database
    String databaseSubdirectory = "WikiDB";
    // the following directory must exist for image downloads
View Full Code Here

  }

  public static void testWikipediaText(String rawWikiText, String title, String apiLink, Locale locale) {
    String[] listOfTitleStrings = { title };
    String titleURL = Encoder.encodeTitleLocalUrl(title);
    User user = new User("", "", apiLink);
    String mainDirectory = "c:/temp/";
    // the following subdirectory should not exist if you would like to create a
    // new database
    String databaseSubdirectory = "WikiDB";
    // the following directory must exist for image downloads
View Full Code Here

   *         is set in the wiki text; <code>null</code> otherwise
   */
  public static String testWikipediaENAPI(String title, String apiLink, Locale locale) {
    String[] listOfTitleStrings = { title };
    String titleURL = Encoder.encodeTitleLocalUrl(title);
    User user = new User("", "", apiLink);
    user.login();
    String mainDirectory = "c:/temp/";
    // the following subdirectory should not exist if you would like to create a
    // new database
    String databaseSubdirectory = "WikiDB";
    // the following directory must exist for image downloads
View Full Code Here

    assertEquals("action=parse&amp;format=xml&amp;text={{Project:Sandbox}}&amp;title=A Sandbox Template test", request.toString());
  }

  public void testParseQuery() {

    User user = getAnonymousUser();
    Connector connector = new Connector();
    user = connector.login(user);
    // System.out.println(user.getToken());
    RequestBuilder request = Parse.create().page("Main Page");
    ParseData parseData = connector.parse(user, request);
View Full Code Here

  }

  public static void testWikipediaENAPI(String title, String apiLink) {
    String[] listOfTitleStrings = { title };
    String titleURL = Encoder.encodeTitleLocalUrl(title);
    User user = new User("", "", apiLink);
    user.login();
    String mainDirectory = "c:/temp/";
    // the following subdirectory should not exist if you would like to create a
    // new database
    String databaseSubdirectory = "WikiDB";
    // the following directory must exist for image downloads
View Full Code Here

  }

  public static void testWikipediaText(String rawWikiText, String title, String apiLink, Locale locale) {
    String[] listOfTitleStrings = { title };
    String titleURL = Encoder.encodeTitleLocalUrl(title);
    User user = new User("", "", apiLink);
    String mainDirectory = "c:/temp/";
    // the following subdirectory should not exist if you would like to create a
    // new database
    String databaseSubdirectory = "WikiDB";
    // the following directory must exist for image downloads
View Full Code Here

   *         is set in the wiki text; <code>null</code> otherwise
   */
  public static String testWikipediaENAPI(String title, String apiLink, Locale locale) {
    String[] listOfTitleStrings = { title };
    String titleURL = Encoder.encodeTitleLocalUrl(title);
    User user = new User("", "", apiLink);
    user.login();
    String mainDirectory = "c:/temp/";
    // the following subdirectory should not exist if you would like to create a
    // new database
    String databaseSubdirectory = "WikiDB";
    // the following directory must exist for image downloads
View Full Code Here

  }

  private static void testWikipediaENAPI(String title) {
    String[] listOfTitleStrings = { title };
    String titleURL = Encoder.encodeTitleLocalUrl(title);
    User user = new User("", "", "http://en.wikipedia.org/w/api.php");
    user.login();
    WikiDB db = null;
    String mainDirectory = "c:/temp/";
    // the following subdirectory should not exist if you would like to create a
    // new database
    String databaseSubdirectory = "WikiDB";
View Full Code Here

  private static void testWikipediaENAPI(String title) throws Exception {
    String articleAddress = "http://en.wikipedia.org/w/api.php?action=query&titles=" + Encoder.encodeTitleToUrl(title, true)
        + "&prop=revisions&rvprop=content&format=xml";
    String articleWikiContent = loadRAWContent(articleAddress);

    User wikiUser = new User("", "", "http://en.wikipedia.org/w/api.php");
    wikiUser.login();

    // set up a simple cache for this example. HashMap is not usable for
    // production! Use something like http://ehcache.org for production!
    Map<String, String> contentCache = new HashMap<String, String>(2000);
    APIWikiModelInMemory wikiModel = new APIWikiModelInMemory(wikiUser, Locale.ENGLISH, "${image}", "${title}", contentCache);
View Full Code Here

TOP

Related Classes of info.bliki.api.User

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.