- if (!strncasecmp(c, "consumer_key", 12) &&
- (c[12] == '=')) {
- c += 13;
- if (c[0] != '\0')
- consumer_key = strdup(c);
- } else if (!strncasecmp(c, "consumer_secret", 15) &&
- (c[15] == '=')) {
- c += 16;
- if (c[0] != '\0')
- consumer_secret = strdup(c);
- } else if (!strncasecmp(c, "access_token_key", 16) &&
- (c[16] == '=')) {
- c += 17;
- if (c[0] != '\0')
- access_token_key = strdup(c);
- } else if (!strncasecmp(c, "access_token_secret", 19) &&
- (c[19] == '=')) {
- c += 20;
- if (c[0] != '\0')
- access_token_secret = strdup(c);
- } else if (!strncasecmp(c, "host", 4) &&
- (c[4] == '=')) {
- c += 5;
- if (c[0] != '\0')
- host = strdup(c);
- } else if (!strncasecmp(c, "proxy", 5) &&
- (c[5] == '=')) {
- c += 6;
- if (c[0] != '\0')
- proxy = strdup(c);
- } else if (!strncasecmp(c, "logfile", 7) &&
- (c[7] == '=')) {
- c += 8;
- if (c[0] != '\0')
- logfile = strdup(c);
- } else if (!strncasecmp(c, "action", 6) &&
- (c[6] == '=')) {
- c += 7;
- if (c[0] != '\0')
- action = strdup(c);
- } else if (!strncasecmp(c, "user", 4) &&
- (c[4] == '=')) {
- c += 5;
- if (c[0] != '\0')
- user = strdup(c);
- } else if (!strncasecmp(c, "shrink-urls", 11) &&
- (c[11] == '=')) {
- c += 12;
- if (!strncasecmp(c, "true", 4) ||
- !strncasecmp(c, "yes", 3))
- shrink_urls = 1;
- } else if (!strncasecmp(c, "verbose", 7) &&
- (c[7] == '=')) {
- c += 8;
- if (!strncasecmp(c, "true", 4) ||
- !strncasecmp(c, "yes", 3))
- verbose = 1;
- }
- } while (!feof(config_file));
-
- if (consumer_key)
- session->consumer_key = consumer_key;
- if (consumer_secret)
- session->consumer_secret = consumer_secret;
- if (access_token_key)
- session->access_token_key = access_token_key;
- if (access_token_secret)
- session->access_token_secret = access_token_secret;
- if (host) {
- if (strcasecmp(host, "twitter") == 0) {
- session->host = HOST_TWITTER;
- session->hosturl = strdup(twitter_host);
- session->hostname = strdup(twitter_name);
- } else if (strcasecmp(host, "identica") == 0) {
- session->host = HOST_IDENTICA;
- session->hosturl = strdup(identica_host);
- session->hostname = strdup(identica_name);
- } else {
- session->host = HOST_CUSTOM;
- session->hosturl = strdup(host);
- session->hostname = strdup(host);
+ case ACTION_REPLIES:
+ snprintf(user_password, sizeof(user_password), "%s:%s",
+ session->account, session->password);
+ sprintf(endpoint, "%s%s?page=%d", session->hosturl,
+ replies_uri, session->page);
+ curl_easy_setopt(curl, CURLOPT_URL, endpoint);
+ curl_easy_setopt(curl, CURLOPT_USERPWD, user_password);
+ break;
+
+ case ACTION_PUBLIC:
+ sprintf(endpoint, "%s%s?page=%d", session->hosturl,
+ public_uri, session->page);
+ curl_easy_setopt(curl, CURLOPT_URL, endpoint);
+ break;
+
+ case ACTION_GROUP:
+ sprintf(endpoint, "%s%s%s.xml?page=%d",
+ session->hosturl, group_uri, session->group,
+ session->page);
+ curl_easy_setopt(curl, CURLOPT_URL, endpoint);
+ break;
+
+ default:
+ break;