Beispiel #1
0
int
main( int argc, char *argv[] )
{
    BOOL    useProxy = FALSE;
    char    ibID[MAX_USERIDLEN];
    int     numOfClips = 0;
    MyClip  *mp = NULL;

    if ( argc <= 1 ) {
        usage();
        return ( 0 );
    }

    memset( ibID, 0x00, MAX_USERIDLEN );

    if ( argc >= 2 )
        setParam( argc, argv, ibID, &useProxy );

    if ( !(ibID[0]) )
        return ( 0 );

    if ( useProxy )
        setUseProxy( useProxy );

    /* BlogPeople IB へ登録済みのブックマークを取得 */
    mp = getIB( ibID, &numOfClips );
    if ( mp && (numOfClips > 0) ) {
        /*  BlogPeople IB 情報を OPML ファイルへ書き出す */
        outputOPML( mp, numOfClips,
                    "BlogPeople Instant Bookmarks", UTF8, stdout );
        free( mp );
    }

    return ( 1 );
}
Beispiel #2
0
int
main( int argc, char *argv[] )
{
    BOOL    useProxy = FALSE;
    char    username[MAX_USERIDLEN];
    int     numOfClips = 0;
    int     total      = 0;
    MyClip  *mp = NULL;

    if ( argc <= 1 ) {
        usage();
        return ( 0 );
    }

    memset( username, 0x00, MAX_USERIDLEN );

    if ( argc >= 2 )
        setParam( argc, argv, username, &useProxy );

    if ( !(username[0]) )
        return ( 0 );

    if ( useProxy )
        setUseProxy( useProxy );

    /* BlogPeople Tags へ登録済みのブックマークを取得 */
    mp = getBPTags( username, &total, &numOfClips );

    if ( (total > 0) && (numOfClips < total) ) {
        if ( getLanguageCode() == 0x0411 )
            fprintf( stderr,
                     "警告: 全 %d 件中、%d 件しか取得できませんでした\n",
                     total, numOfClips );
        else
            fprintf( stderr,
                     "Warning: Only %d in %d all was able to be acquired.\n",
                     numOfClips, total );
    }

    if ( mp && (numOfClips > 0) ) {
        /*  BlogPeople Tags 情報を OPML ファイルへ書き出す */
        outputOPML( mp, numOfClips, "BlogPeople Tags", SJIS2UTF, stdout );
        free( mp );
    }

    return ( 1 );
}
Beispiel #3
0
int
main( int argc, char *argv[] )
{
    int     numOfClips = 0;
    char    username[MAX_USERIDLEN + 1];
    char    password[MAX_PASSWDLEN + 1];
    BOOL    useProxy = FALSE;
    FILE    *fp = stdin;
    MyClip  *mp = NULL;

    if ( argc <= 1 ) {
        usage();
        return ( 0 );
    }

    memset( username, 0x00, MAX_USERIDLEN );
    memset( password, 0x00, MAX_PASSWDLEN );

    if ( argc >= 2 )
        setParam( argc, argv,
                  username, password,
                  &useProxy, &fp );

    if ( !(username[0]) || !(password[0]) )
        return ( 0 );

    if ( useProxy )
        setUseProxy( useProxy );

    /* OPMLファイルからブックマークを取得 */
    mp = inputOPML( &numOfClips, fp );
    if ( fp && (fp != stdin) )
        fclose( fp );

    if ( mp && (numOfClips > 0) ) {
        /* ブックマークを Diigo に登録 */
        putDiigo( username, password, mp, numOfClips );
        free( mp );
    }

    return ( 1 );
}
Beispiel #4
0
void CoreAccount::fromVariantMap(const QVariantMap &v)
{
    setAccountId((AccountId)v.value("AccountId").toInt());
    setAccountName(v.value("AccountName").toString());
    setUuid(QUuid(v.value("Uuid").toString()));
    setInternal(v.value("Internal").toBool());
    setUser(v.value("User").toString());
    setPassword(v.value("Password").toString());
    setStorePassword(v.value("StorePassword").toBool());
    setHostName(v.value("HostName").toString());
    setPort(v.value("Port").toUInt());
    setUseSsl(v.value("UseSSL").toBool());
    setUseProxy(v.value("UseProxy").toBool());
    setProxyType((QNetworkProxy::ProxyType)v.value("ProxyType").toInt());
    setProxyUser(v.value("ProxyUser").toString());
    setProxyPassword(v.value("ProxyPassword").toString());
    setProxyHostName(v.value("ProxyHostName").toString());
    setProxyPort(v.value("ProxyPort").toUInt());

    _storePassword = !password().isEmpty();
}
Beispiel #5
0
int
main( int argc, char *argv[] )
{
    BOOL    useProxy = FALSE;
    char    username[MAX_USERIDLEN];
    char    password[MAX_PASSWDLEN];
    int     numOfClips = 0;
    int     total      = 0;
    MyClip  *mp = NULL;

    if ( argc <= 1 ) {
        usage();
        return ( 0 );
    }

    memset( username, 0x00, MAX_USERIDLEN );
    memset( password, 0x00, MAX_PASSWDLEN );

    if ( argc >= 2 )
        setParam( argc, argv, username, password, &useProxy );

    if ( !(username[0]) || !password[0] )
        return ( 0 );

    if ( useProxy )
        setUseProxy( useProxy );

    /* Diigo へ登録済みのブックマークを取得 */
    mp = getDiigo( username, password, &numOfClips );

    if ( mp && (numOfClips > 0) ) {
        /*  Diigo のブックマーク情報を OPML ファイルへ書き出す */
        outputOPML( mp, numOfClips, "JoltMark", SJIS2UTF, stdout );
        free( mp );
    }

    return ( 1 );
}
Beispiel #6
0
int
main( int argc, char *argv[] )
{
    int     verbose    = 0;
    int     useProxy   = 0;
    int     i, j;
    char    usernameLivedoor[80];
    char    passwordLivedoor[80];
    char    usernameFC2N[80];
    char    passwordFC2N[80];
    char    editorPath[MAX_PATH];
    int     ret = 0;
    char    *p;
    FILE    *fp;

    usernameLivedoor[0] = NUL;
    passwordLivedoor[0] = NUL;
    usernameFC2N[0]     = NUL;
    passwordFC2N[0]     = NUL;
    editorPath[0]       = NUL;

    for ( i = 1; i < argc; i++ ) {
        if ( argv[i][0] != '-' )
            break;
        for ( j = 1; argv[i][j]; j++ ) {
            switch ( argv[i][j] ) {
            case 'v':
                verbose = !verbose;
                break;

            case 'p':
                useProxy = !useProxy;
                break;

            case 'e':
                if ( argv[i][j + 1] )
                    strcpy( editorPath, &(argv[i][j + 1]) );
                else if ( i + 1 < argc )
                    strcpy( editorPath, argv[++i] );
                else
                    continue;
                j = strlen( argv[i] ) - 1;
                break;
            }
        }
    }

    fp = fopen( "setting.inf", "r" );
    if ( fp ) {
        char    buf[BUFSIZ], *q;
        int     cnt = 0;
        while ( ( p = fgets( buf, BUFSIZ - 1, fp ) ) != NULL ) {
            while ( (*p == ' ') || (*p == '\t') )
                p++;
            if ( (*p == '#') || (*p == '\n') || (*p == '\r') )
                continue;
            q = p + strlen( p );
            while ( --q > p ) {
                if ( (*q == '\n') || (*q == '\r') ||
                     (*q == ' ')  || (*q == '\t')    )
                    *q = NUL;
                else
                    break;
            }
            if ( !(*p) || (p == q) )
                continue;

            switch ( cnt ) {
            case 0:
                strcpy( usernameLivedoor, p );
                break;
            case 1:
                strcpy( passwordLivedoor, p );
                break;
            case 2:
                strcpy( usernameFC2N, p );
                break;
            case 3:
                strcpy( passwordFC2N, p );
                break;
            }

            if ( ++cnt >= 4 )
                break;
        }
        fclose( fp );
    }

    /* livedoor Blog */
    if ( usernameLivedoor[0] == NUL ) {
        do {
            fputs( "[livedoor Blog] Username: "******"[livedoor Blog] Password: "******"[FC2NETWORK] Username: "******"[FC2NETWORK] Password: ", stderr );
            p = fgets( passwordFC2N, 79, stdin );
            if ( !p ) {
                clearerr( stdin );
                passwordFC2N[0] = '\0';
            }
            while ( passwordFC2N[strlen(passwordFC2N) - 1] == '\n' ) {
                passwordFC2N[strlen(passwordFC2N) - 1] = '\0';
                if ( passwordFC2N[0] == '\0' )
                    break;
            }
        } while ( passwordFC2N[0] == '\0' );
    }

    setUserInfo( usernameLivedoor, passwordLivedoor );
    setVerbose( verbose, stderr );
    setUseProxy( useProxy );

    ret = interDiary( usernameLivedoor, usernameFC2N, passwordFC2N,
                      editorPath );

    return ( ret );
}
Beispiel #7
0
int
main( int argc, char *argv[] )
{
    char    username[80];
    char    password[80];
    char    rootURL[384];
    int     i;
    int     useProxy = FALSE;
    int     verbose  = TRUE;

    memset( username, 0x00, 80 );
    memset( password, 0x00, 80 );
    memset( rootURL,  0x00, 384 );

    useProxy = isUsedProxy();

    if ( argc <= 1 ) {
        usage();
        return ( 254 );
    }

    for ( i = 1; i < argc; i++ ) {
        if ( argv[i][0] == '-' ) {
            switch ( argv[i][1] ) {
            case 'u':
                if ( argv[i][2] )
                    strcpy( username, &argv[i][2] );
                else if ( i + 1 < argc )
                    strcpy( username, argv[++i] );
                break;
            case 'p':
                if ( argv[i][2] )
                    strcpy( password, &argv[i][2] );
                else if ( i + 1 < argc )
                    strcpy( password, argv[++i] );
                break;
            case 's':
                verbose = FALSE;
                break;
            }

            continue;
        }
        else
            strcpy( rootURL, argv[i] );
    }

    if ( rootURL[0] == NUL ) {
        fprintf( stderr, "freshreader のルート URL を指定してください" );
        return ( 255 );
    }
    if ( strncmp( rootURL, "http", 4 ) != 0 ) {
        fprintf( stderr, "正しい URL を指定してください" );
        return ( 255 );
    }
    if ( rootURL[strlen(rootURL) - 1] != '/' )
        strcat( rootURL, "/" );

    if ( username[0] == NUL )
        inputString( username,
                     "ユーザ名: ", FALSE );

    if ( password[0] == NUL )
        inputString( password,
                     "パスワード: ", TRUE );

    setUseProxy( useProxy );
    subcrawler( rootURL, username, password, verbose );

    return ( 1 );
}