private static void GetBrowserMonthLast2() { var userSettings = new UserSettings(); userSettings.setTokenAuth("XYZ"); var results = (Hashtable)userSettings.getBrowser(1, PiwikPeriod.MONTH, RelativeRangeDate.LAST(2)); Console.WriteLine(results.Count + " results found"); // The request if for multiple periods // Loop over the requested periods foreach (String period in results.Keys) { Console.WriteLine("Data for " + period); // Loop over each browser name (ie. LABEL) foreach (Hashtable result in (ArrayList)results[period]) { // Display browser stats Console.WriteLine( result[UserSettings.LABEL] + " " + result[UserSettings.NB_UNIQ_VISITORS] + " " + result[UserSettings.NB_VISITS] + " " + result[UserSettings.NB_ACTIONS] + " " + result[UserSettings.MAX_ACTIONS] + " " + result[UserSettings.SUM_VISIT_LENGTH] + " " + result[UserSettings.BOUNCE_COUNT] + " " + result[UserSettings.NB_VISITS_CONVERTED] + " " + result[UserSettings.SUM_DAILY_NB_UNIQ_VISITORS] + " " + result[UserSettings.LOGO] + " " + result[UserSettings.SHORTLABEL] ); } } }
private static void GetBrowserRangeYear() { var userSettings = new UserSettings(); userSettings.setTokenAuth("XYZ"); var results = (ArrayList)userSettings.getBrowser( 1, PiwikPeriod.RANGE, new AbsoluteRangeDate(DateTime.Now.AddDays(-365), DateTime.Now) ); Console.WriteLine(results.Count + " results found"); // Loop over each browser name (ie. LABEL) foreach (Hashtable result in results) { // Display browser stats Console.WriteLine( result[UserSettings.LABEL] + " " + result[UserSettings.NB_UNIQ_VISITORS] + " " + result[UserSettings.NB_VISITS] + " " + result[UserSettings.NB_ACTIONS] + " " + result[UserSettings.MAX_ACTIONS] + " " + result[UserSettings.SUM_VISIT_LENGTH] + " " + result[UserSettings.BOUNCE_COUNT] + " " + result[UserSettings.NB_VISITS_CONVERTED] + " " + result[UserSettings.SUM_DAILY_NB_UNIQ_VISITORS] + " " + result[UserSettings.LOGO] + " " + result[UserSettings.SHORTLABEL] ); } }
private static void GetOs() { var userSettings = new UserSettings(); //userSettings.setTokenAuth("XYZ"); var results = (ArrayList)userSettings.getOS( 7, PiwikPeriod.YEAR, MagicDate.TODAY ); Console.WriteLine(results.Count + " results found"); // Loop over each OS name (ie. LABEL) foreach (Hashtable result in results) { // Display OS stats Console.WriteLine( result[UserSettings.LABEL] + " " + result[UserSettings.NB_UNIQ_VISITORS] + " " + result[UserSettings.NB_VISITS] + " " + result[UserSettings.NB_ACTIONS] + " " + result[UserSettings.MAX_ACTIONS] + " " + result[UserSettings.SUM_VISIT_LENGTH] + " " + result[UserSettings.BOUNCE_COUNT] + " " + result[UserSettings.NB_VISITS_CONVERTED] + " " + result[UserSettings.SUM_DAILY_NB_UNIQ_VISITORS] + " " + result[UserSettings.LOGO] + " " + result[UserSettings.SHORTLABEL] ); } }
private static void GetBrowserMonthSpecificDate() { var userSettings = new UserSettings(); userSettings.setTokenAuth("XYZ"); var results = (ArrayList)userSettings.getBrowser(1, PiwikPeriod.MONTH, new SimpleDate(new DateTime(2011, 09, 18))); System.Console.WriteLine(results.Count + " results found"); // Loop over each browser name (ie. LABEL) foreach (Hashtable result in results) { // Display browser stats Console.WriteLine( result[UserSettings.LABEL] + " " + result[UserSettings.NB_UNIQ_VISITORS] + " " + result[UserSettings.NB_VISITS] + " " + result[UserSettings.NB_ACTIONS] + " " + result[UserSettings.MAX_ACTIONS] + " " + result[UserSettings.SUM_VISIT_LENGTH] + " " + result[UserSettings.BOUNCE_COUNT] + " " + result[UserSettings.NB_VISITS_CONVERTED] + " " + result[UserSettings.SUM_DAILY_NB_UNIQ_VISITORS] + " " + result[UserSettings.LOGO] + " " + result[UserSettings.SHORTLABEL] ); } }