public boolean loadClassDuration(OffRec off, boolean ignoreSSL)
			throws IOException {
		if (off.getKey() == null)
			return false;
		// https://www.edx.org/api/catalog/v2/courses/course-v1:DelftX+TP101x+3T2015
		// "https://www.edx.org/api/catalog/v2/courses/course-v1:";
		String newUrl = "https://www.edx.org/api/catalog/v2/courses/"
				+ off.getKey();
		URL url = new URL(newUrl);
		// All set up, we can get a resource through https now:
		URLConnection urlCon = url.openConnection();
		// Tell the url connection object to use our socket factory which
		// bypasses security checks
		if (ignoreSSL)
			((HttpsURLConnection) urlCon).setSSLSocketFactory(sslSocketFactory);
		InputStream stream = urlCon.getInputStream();
		InputStreamReader reader = new InputStreamReader(stream);

		StringBuffer buffer = HttpHelper.readIntoBuffer(reader);
		stream.close();

		Object data = JsonParser.parse(new StringReader(buffer.toString()));
		try {
			@SuppressWarnings("unchecked")
			String value = (String) ((Map<String, Object>) data).get("length");
			value = value.trim();
			int end = value.indexOf(' ');
			if (end >= 0)
				value = value.substring(0, end);
			int weeks = Integer.parseInt(value);
			off.setDuration(weeks);
			return true;
		} catch (Exception e) {
			System.out.println("Cannot get course length from " + newUrl + ": "
					+ e);
			return false;
		}
	}