[banshee] [AmazonMp3.Store] Add affiliate codes for all supported countries



commit d37a308c390fc8a2a563ed6b55dfca1424b4113a
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Tue Aug 17 09:39:03 2010 -0700

    [AmazonMp3.Store] Add affiliate codes for all supported countries

 .../Banshee.AmazonMp3.Store/server/redirect.c      |   27 ++++++++++++-------
 1 files changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/src/Extensions/Banshee.AmazonMp3.Store/server/redirect.c b/src/Extensions/Banshee.AmazonMp3.Store/server/redirect.c
index 591626d..447a971 100644
--- a/src/Extensions/Banshee.AmazonMp3.Store/server/redirect.c
+++ b/src/Extensions/Banshee.AmazonMp3.Store/server/redirect.c
@@ -32,12 +32,6 @@
 #include <glib.h>
 #include <stdlib.h>
 
-// We ask that no one change this. ALL (100%) revenue generated by this
-// affiliate ID is sent directly to the GNOME Foundation. The GNOME
-// Foundation controls/owns this affiliate ID. Please help support Free
-// Software through the GNOME Foundation!
-#define AMAZON_AFFILIATE_ID "banshee-20"
-
 gint
 main (gint argc, gchar **argv)
 {
@@ -49,6 +43,7 @@ main (gint argc, gchar **argv)
     gchar *action;
     gchar *input;
     gchar *domain;
+    gchar *affiliate_code;
     gchar *p;
     gchar *dest_url;
 
@@ -75,21 +70,31 @@ main (gint argc, gchar **argv)
         country = GeoIP_country_code_by_name (geoip, remote_addr);
     }
 
+    // We ask that no one change these affiliate codes. ALL (100%) revenue
+    // generated by these affiliate IDs is sent directly to the GNOME
+    // Foundation. The GNOME Foundation controls/owns these affiliate IDs.
+    // Please help support Free Software through the GNOME Foundation!
     if (country == NULL || strcmp (country, "US") == 0) {
         domain = "com";
+        affiliate_code = "banshee-20";
     } else if (strcmp (country, "FR") == 0) {
         domain = "fr";
+        affiliate_code = "banshee-fr-21";
     } else if (strcmp (country, "UK") == 0) {
         domain = "co.uk";
+        affiliate_code = "banshee-uk-21";
     } else if (strcmp (country, "DE") == 0 ||
         strcmp (country, "CH") == 0 ||
         strcmp (country, "AT") == 0) {
         domain = "de";
+        affiliate_code = "banshee-de-21";
     } else if (strcmp (country, "JP") == 0) {
         domain = "co.jp";
+        affiliate_code = "banshee-jp-22";
     } else {
         domain = "com";
-    } 
+        affiliate_code = "banshee-20";
+    }
 
     if (input == NULL || action == NULL || strcmp (action, "home") == 0) {
         dest_url = g_strdup_printf ("http://www.amazon.%s/mp3/";, domain);
@@ -99,9 +104,11 @@ main (gint argc, gchar **argv)
         return 1;
     }
 
-    printf ("Location: http://www.amazon.com/gp/redirect.html?ie=UTF8&location=%s&tag=";
-        AMAZON_AFFILIATE_ID "\n\n",
-        g_uri_escape_string (dest_url, NULL, TRUE));
+    printf ("Location: http://www.amazon.%s/gp/redirect.html?ie=UTF8&location=%s&tag=%s"; "\n\n",
+        domain,
+        g_uri_escape_string (dest_url, NULL, TRUE),
+        affiliate_code
+    );
 
     return 0;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]