Mercurial > audlegacy-plugins
comparison src/scrobbler/gerpok.c @ 2904:ff9b4776b938
now scrobbler uses proxy settings;
whole scrobbler plugin needs to be re-written using neon
author | Andrew O. Shadoura <bugzilla@tut.by> |
---|---|
date | Wed, 13 Aug 2008 16:15:29 +0300 |
parents | 19fb7d7dcf4e |
children | 3134a0987162 |
comparison
equal
deleted
inserted
replaced
2903:9c623f4ac901 | 2904:ff9b4776b938 |
---|---|
3 #include <pthread.h> | 3 #include <pthread.h> |
4 #include <limits.h> | 4 #include <limits.h> |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 #include <string.h> | 6 #include <string.h> |
7 #include <stdarg.h> | 7 #include <stdarg.h> |
8 #include <curl/curl.h> | |
9 #include <stdio.h> | 8 #include <stdio.h> |
10 #include "fmt.h" | 9 #include "fmt.h" |
10 #include "plugin.h" | |
11 #include "scrobbler.h" | 11 #include "scrobbler.h" |
12 #include "config.h" | 12 #include "config.h" |
13 #include <glib.h> | 13 #include <glib.h> |
14 #include <audacious/plugin.h> | 14 #include <audacious/plugin.h> |
15 #include <audacious/audutil.h> | 15 #include <audacious/audutil.h> |
414 g_snprintf(buf, sizeof(buf), "%s/?hs=true&p=%s&c=%s&v=%s&u=%s", | 414 g_snprintf(buf, sizeof(buf), "%s/?hs=true&p=%s&c=%s&v=%s&u=%s", |
415 SCROBBLER_HS_URL, SCROBBLER_VERSION, | 415 SCROBBLER_HS_URL, SCROBBLER_VERSION, |
416 SCROBBLER_CLI_ID, SCROBBLER_IMPLEMENTATION, gerpok_sc_username); | 416 SCROBBLER_CLI_ID, SCROBBLER_IMPLEMENTATION, gerpok_sc_username); |
417 | 417 |
418 curl = curl_easy_init(); | 418 curl = curl_easy_init(); |
419 setup_proxy(curl); | |
419 curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1); | 420 curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1); |
420 curl_easy_setopt(curl, CURLOPT_URL, buf); | 421 curl_easy_setopt(curl, CURLOPT_URL, buf); |
421 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, | 422 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, |
422 gerpok_sc_store_res); | 423 gerpok_sc_store_res); |
423 memset(gerpok_sc_curl_errbuf, 0, sizeof(gerpok_sc_curl_errbuf)); | 424 memset(gerpok_sc_curl_errbuf, 0, sizeof(gerpok_sc_curl_errbuf)); |
619 /* struct HttpPost *post = NULL , *last = NULL; */ | 620 /* struct HttpPost *post = NULL , *last = NULL; */ |
620 int status; | 621 int status; |
621 GString *submission; | 622 GString *submission; |
622 | 623 |
623 curl = curl_easy_init(); | 624 curl = curl_easy_init(); |
625 setup_proxy(curl); | |
624 curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1); | 626 curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1); |
625 curl_easy_setopt(curl, CURLOPT_URL, gerpok_sc_submit_url); | 627 curl_easy_setopt(curl, CURLOPT_URL, gerpok_sc_submit_url); |
626 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, | 628 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, |
627 gerpok_sc_store_res); | 629 gerpok_sc_store_res); |
628 curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT); | 630 curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT); |