public static LinkedList<String> getLinks(String data, String url) {
		LinkedList<String> links = new LinkedList<String>();
		URI u;
		String l;
		try {
			u = new URI(url.toLowerCase());
		} catch (Exception e) {
			u = null;
		}

		int pos = 0, posEnd;

		while (true) {
			pos = data.indexOf("<a", pos);
			if (pos == -1)
				break;
			pos = data.indexOf("href", pos + 1);
			if (pos == -1)
				break;
			pos = data.indexOf("\"", pos + 1);
			if (pos == -1)
				break;
			posEnd = data.indexOf("\"", pos + 1);
			if (posEnd == -1)
				break;

			l = data.substring(pos + 1, posEnd).toLowerCase();
			if (u != null)
				l = u.resolve(l).toString();
			links.add(l);
			pos = posEnd + 1;
		}

		return links;
	}