Check the Chrome extension, http://bit.ly/course-cal
Developing tree is master. You don't have to hack master tree normally. Please download release version if you want to host Course Cal yourself.
Course Cal, works with NTU S.T.A.R.S planner.
Course Cal can generate calendar which can be imported to Apple iCal, Google Calendar and Outlook Calendar with simply pasting course printable page url.
Visit http://ciel.im/course.
- Change app.yaml to your own settings (works with GAE).
- Change mail.php to your own settings (works with GAE).
- Send printable page url to perform.php via post/get request.
You can host it with any php server, but mail.php can only work with GAE.
You may send GET/POST request to perform.php
(You can also send post request to http://course-cal.appspot.com/perform.php). perform.php
get JSON string from json
:
$json_data = array_key_exists('json', $_REQUEST) ? $_REQUEST['json'] : null;
So you may have a hidden input named json
, and use it to send data.
<input type="hidden" name="json" id="json" value="">
Submit by
$('input#submit').click(function(){
var json = {'url': $('input#url').val()};
var element = document.getElementById("json");
element.value = JSON.stringify(json);
element.form.submit();
});
You can create Course Cal by yourself with JSON. You shold post the JSON string as json
as well. An example is here. You can send JSON string using the same method with printable page url. Note that if there is url
in JSON string, all other things will be ignored. There are two modes - auto or manual.
Auto mode. Course Cal can create event automatically with course code and index (may slower than manual mode).
Manual mode. Course Cal can create event automatically with course information (need more information than auto mode).
var json_auto_mode = {
"mode" : "auto",
"unique_id" : "auto_mode",
"tz" : "Asia/Singapore",
"filename": "Course-Cal",
"year" : "2013",
"sem" : "2",
"courses" : [
{
"code" : "CZ2006",
"index" : "10271",
"examTime" : {
"year" : "2014",
"month" : "jan",
"day" : "1",
"startTime" : "0800",
"endTime" : "0900"
}
},
{
"code" : "CZ2007",
"index" : "10281"
}
]
};
var json_manual_mode = {
"mode" : "manual",
"unique_id" : "manual_mode",
"tz" : "Asia/Singapore",
"filename": "Course-Cal",
"year" : "2013",
"sem" : "2",
"courses" : [
{
"code" : "CI1011",
"index" : "314159",
"name" : "I love Ciel",
"au" : "3 au",
"examTime" : {
"year" : "2014",
"month" : "jan",
"day" : "1",
"startTime" : "0800",
"endTime" : "0900"
},
"lessons" : [
{
"type" : "LEC",
"group" : "FSP2",
"time" : {
"startTime" : "0830",
"endTime" : "0930",
"wkDay" : "mon"
},
"venue" : "LT2A",
"remark" : "wk2-4,5,8-9"
}
]
}
]
};
-
mode
: optional, set toauto
by default. -
unique_id
: optional, set to random number by default. -
tz
: optional, set toAsia/Singapore
by default. -
filename
: optional, set toCourse_Cal_file
by default. -
year
andsem
: necessary.year
andsem
are used to get the semester information.year = 2013 sem = 1
means second half year of 2013, andyear = 2013 sem = 2
means first half year of 2014. -
courses
: necessary.courses
is an array which contains all courses.-
Auto mode:
code
: necessary.index
: necessary.examTime
: optional, but if you set this, you have to set all properties.
-
Manual mode:
-
code
: necessary. -
index
: optional. -
name
: optional. -
au
: optional. -
examTime
: optional, but if you set this, you have to set all properties. -
lessons
: optional,lessons
is an array which contains all lessons. if you set this, you should follow:type
: optional, set to '' by default.group
: optional, set to '' by default.time
: necessary, you have to point out start time, end time and week day.venue
: optional, set to '' by default.remark
: optional, set to 'Invalid' by default.remark
is used to get week repeat information (jump recess week automatically). Ifremark
is '', this lesson will repeat every week.remark
accept these kinds of syntax:wk2-13
,wk2,3,4,5
,wk2-4,6,8,9-10
.
-
-
Current API Version 1.1.2
Last stable API Version 1.1.2
- API changes
- PHP Code - send pull request to master branch