Esempio n. 1
0
        private List <CanvasModule> GetModuleFromId(string id)
        {
            var    canvas = new CanvasGrabber($"/api/v1/courses/{id}/modules");
            string res    = canvas.GetAuthResponse(System.Environment.GetEnvironmentVariable("CANVAS_API_TOKEN")).Result;

            System.IO.File.WriteAllText($"./output/{id}_modules.json", res);
            return(JsonConvert.DeserializeObject <List <CanvasModule> >(res));
        }
Esempio n. 2
0
        static async Task Main(string[] args)
        {
            // await GetTrumpData();
            //await DownloadGifs();
            var grabber = new CanvasGrabber("/api/v1/courses/59796/group_categories");
            var data    = await grabber.GetAuthResponse(System.Environment.GetEnvironmentVariable("API_TOKEN"));

            System.IO.File.WriteAllText("./output/group_categories.json", data);
        }
Esempio n. 3
0
        private List <CanvasModule> GetBluePrintCourse(string id)
        {
            var    canvas = new CanvasGrabber($"/api/v1/courses/{id}/blueprint_subscriptions");
            string res    = canvas.GetAuthResponse(System.Environment.GetEnvironmentVariable("CANVAS_API_TOKEN")).Result;

            if (res.Equals("[]"))
            {
                throw new Exception($"There are no blueprint subscriptions for the course {id} ! We have nothing to compare the course copy with!");
            }
            res = res.Substring(1, res.Length - 2);
            var blueprint = JsonConvert.DeserializeObject <CanvasBlueprintSubscription>(res);

            return(GetModuleFromId((blueprint.BlueprintCourse.Id.ToString())));
        }