Requirement: libcurl4-openssl-dev
Get Plurk API Key: Goto
http://www.plurk.com/API/1.0/ to get an API key (Fill the form, and click "Issue API key")
Plurk.c: (need API_KEY/USERNAME/PASSWORD)
#include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
int main (int argc, char *argv[])
{
char POST[256];
CURL *curl;
curl = curl_easy_init ();
sprintf (POST, "api_key=API_KEY&username=USERNAME&password=PASSWORD&no_data=1");
curl_easy_setopt (curl, CURLOPT_URL, "http://www.plurk.com/API/Users/login");
curl_easy_setopt (curl, CURLOPT_POSTFIELDS, POST);
curl_easy_setopt (curl, CURLOPT_COOKIEFILE, "cookie.txt");
curl_easy_setopt (curl, CURLOPT_COOKIEJAR, "cookie.txt");
curl_easy_perform (curl); /* Perform Login */
sprintf (POST, "api_key=API_KEY&qualifier=says&lang=tr_ch&content=!FB %s", argv[1]);
curl_easy_setopt (curl, CURLOPT_URL, "http://www.plurk.com/API/Timeline/plurkAdd");
curl_easy_setopt (curl, CURLOPT_POSTFIELDS, POST);
curl_easy_setopt (curl, CURLOPT_COOKIEFILE, "cookie.txt");
curl_easy_setopt (curl, CURLOPT_COOKIEJAR, "cookie.txt");
curl_easy_perform (curl); /* Perform an Plurk messge and this message willnot send to Facebook */
curl_easy_cleanup (curl);
return 0;
}
Makefile:
all: Plurk.c
gcc -o Plurk Plurk.c -lcurl
Usage
>> ./Plurk "Plurk API Test"
Finish