src/Main/PixivAPI/User.java
public void initialize() throws RuntimeException //TODO Split into multiple functions reduce page loads
    {
        Elements ele;
        String temp;
        Document page = getHTML(url);

        // Checks User ID is valid
        ele = page.getElementsByClass("error-title");
        if(ele.size() != 0)
        {
            throw new RuntimeException("Bad User ID");
        }

        // Checks Session ID is valid
        ele = page.getElementsByClass("newindex-signup");
        if(ele.size() != 0)
        {
            throw new RuntimeException("Bad Session ID");
        }

        // Sets name
        name = page.getElementsByClass("user-name").first().text();

        // Sets bookmarksSize
        page = getHTML("https://www.pixiv.net/bookmark.php?id=" + ID);
        ele = page.getElementsByClass("count-badge");

        temp = ele.first().text();
        temp = Pattern.compile("[^\\d]").matcher(temp).replaceAll("");
        bookmarksSize = Integer.parseInt(temp);


        // Sets worksSize
        page = getHTML("https://www.pixiv.net/member_illust.php?id=" + ID);
        ele = page.getElementsByClass("count-badge");

        temp = ele.first().text();
        temp = Pattern.compile("[^\\d]").matcher(temp).replaceAll("");
        worksSize = Integer.parseInt(temp);

        // Sets bookmarkedUsersSize
        page = getHTML("https://www.pixiv.net/bookmark.php?type=user&id=" + ID);
        ele = page.getElementsByClass("count-badge");

        temp = ele.first().text();
        bookmarkedUsersSize = Integer.parseInt(temp);

        // Sets myPixivSize
        page = getHTML("https://www.pixiv.net/mypixiv_all.php?id=" + ID);
        ele = page.getElementsByClass("count-badge");

        temp = ele.first().text();
        myPixivSize = Integer.parseInt(temp);

        // Marks completed
        initialized = true;
    }
/**
     * This function initializes fields and checks the the user ID and session ID are valid.
     * If they are not valid this function throws a runtime error, which can be caught.
     *
     * Because this function makes a connection over the internet, it's very slow to finish, therefore
     * it should only be called if there is a request for data that needs that connection, or if an ID needs to be
     * validated.
     * @throws RuntimeException If this object's ID or session are invalid.
     */
This function initializes fields and checks the the user ID and session ID are valid.
If they are not valid this function throws a runtime error, which can be caught.

Because this function makes a connection over the internet, it's very slow to finish, therefore
it should only be called if there is a request for data that needs that connection, or if an ID needs to be
validated.
@throws RuntimeException If this object's ID or session are invalid.
This function initializes fields and checks the the user ID and session ID are valid . If they are not valid this function throws a runtime error which can be caught . Because this function makes a connection over the internet it ' s very slow to finish therefore it should only be called if there is a request for data that needs that connection or if an ID needs to be validated . @throws RuntimeException If this object ' s ID or session are invalid .
public void initialize() throws RuntimeException 
    {
        Elements ele;
        String temp;
        Document page = getHTML(url);
        ele = page.getElementsByClass("error-title");
        if(ele.size() != 0)
        {
            throw new RuntimeException("Bad User ID");
        }
        ele = page.getElementsByClass("newindex-signup");
        if(ele.size() != 0)
        {
            throw new RuntimeException("Bad Session ID");
        }
        name = page.getElementsByClass("user-name").first().text();
        page = getHTML("https://www.pixiv.net/bookmark.php?id=" + ID);
        ele = page.getElementsByClass("count-badge");
        temp = ele.first().text();
        temp = Pattern.compile("[^\\d]").matcher(temp).replaceAll("");
        bookmarksSize = Integer.parseInt(temp);
        page = getHTML("https://www.pixiv.net/member_illust.php?id=" + ID);
        ele = page.getElementsByClass("count-badge");
        temp = ele.first().text();
        temp = Pattern.compile("[^\\d]").matcher(temp).replaceAll("");
        worksSize = Integer.parseInt(temp);
        page = getHTML("https://www.pixiv.net/bookmark.php?type=user&id=" + ID);
        ele = page.getElementsByClass("count-badge");
        temp = ele.first().text();
        bookmarkedUsersSize = Integer.parseInt(temp);
        page = getHTML("https://www.pixiv.net/mypixiv_all.php?id=" + ID);
        ele = page.getElementsByClass("count-badge");
        temp = ele.first().text();
        myPixivSize = Integer.parseInt(temp);
        initialized = true;
    }
public void initialize ( ) throws RuntimeException { Elements ele ; String temp ; Document page = getHTML ( url ) ; ele = page . getElementsByClass ( "error-title" ) ; if ( ele . size ( ) != 0 ) { throw new RuntimeException ( "Bad User ID" ) ; } ele = page . getElementsByClass ( "newindex-signup" ) ; if ( ele . size ( ) != 0 ) { throw new RuntimeException ( "Bad Session ID" ) ; } name = page . getElementsByClass ( "user-name" ) . first ( ) . text ( ) ; page = getHTML ( "https://www.pixiv.net/bookmark.php?id=" + ID ) ; ele = page . getElementsByClass ( "count-badge" ) ; temp = ele . first ( ) . text ( ) ; temp = Pattern . compile ( "[^\\d]" ) . matcher ( temp ) . replaceAll ( "" ) ; bookmarksSize = Integer . parseInt ( temp ) ; page = getHTML ( "https://www.pixiv.net/member_illust.php?id=" + ID ) ; ele = page . getElementsByClass ( "count-badge" ) ; temp = ele . first ( ) . text ( ) ; temp = Pattern . compile ( "[^\\d]" ) . matcher ( temp ) . replaceAll ( "" ) ; worksSize = Integer . parseInt ( temp ) ; page = getHTML ( "https://www.pixiv.net/bookmark.php?type=user&id=" + ID ) ; ele = page . getElementsByClass ( "count-badge" ) ; temp = ele . first ( ) . text ( ) ; bookmarkedUsersSize = Integer . parseInt ( temp ) ; page = getHTML ( "https://www.pixiv.net/mypixiv_all.php?id=" + ID ) ; ele = page . getElementsByClass ( "count-badge" ) ; temp = ele . first ( ) . text ( ) ; myPixivSize = Integer . parseInt ( temp ) ; initialized = true ; }
This function initializes fields and checks the the user ID and session ID are valid.
This function initializes fields and checks the the user ID and session ID are valid .
//TODO Split into multiple functions reduce page loads // Checks User ID is valid // Checks Session ID is valid // Sets name // Sets bookmarksSize // Sets worksSize // Sets bookmarkedUsersSize // Sets myPixivSize // Marks completed