URL_NYAA = "http://www.nyaa.se/?page=rss";
URL_NYAA_SUKEBEI = "http://sukebei.nyaa.se/?page=rss";

function nyaa_fetch(page, search_info, callback) {
	var url = _nyaa_create_url(page, search_info);
	
	$.get(url, function(data) {
		var xml = $(data);
		
		var items = [];
		
		$(xml).find("item").each(function() {
			var item = {
				title: $(this).find("title").text(),
				category: $(this).find("category").text(),
				download_link: $(this).find("link").text(),
				page_link: $(this).find("guid").text(),
				description: $(this).find("description").text()
			};
			
			items.push(item);
		});
		
		callback(items);
	});
}

function _nyaa_create_url(page, search_info) {
	if(!search_info) {
		search_info = {};
	}
	
	var url = search_info.base_url ? search_info.base_url : URL_NYAA;
	
	url += page ? "&offset=" + page : "";
	
	// TODO: add category, filter, sort and order options
	
	url += search_info.query ? "&term=" + search_info.query.join("+") : "";
	
	return url;
}
@@ -307,16 +307,416 @@
 ion() %7B%0A
+%09%09%09var description = $(this).find(%22description%22).text();%0A%09%09%0A%09%09%09var desc_raw = description.split(%22, %22);%0A%09%09%09%0A%09%09%09var seeds = desc_raw%5B0%5D.split(' ')%5B0%5D;%0A%09%09%09var leech = desc_raw%5B1%5D.split(' ')%5B0%5D;%0A%09%09%09%0A%09%09%09var tmp = desc_raw%5B2%5D.split(' - ');%0A%09%09%09%0A%09%09%09var downloads = tmp%5B0%5D.split(' ')%5B0%5D;%0A%09%09%09var size = tmp%5B1%5D;%0A%09%09%09%0A%09%09%09var trusted = false;%0A%09%09%09%0A%09%09%09if(tmp.length %3E 2) %7B%0A%09%09%09%09trusted = tmp%5B2%5D == %22Trusted%22;%0A%09%09%09%7D%0A%09%09%0A
 %09%09%09var i
@@ -911,65 +911,134 @@
 %09%09%09%09
-description: $(this).find(%22description%22).text()%0A%09%09%09%7D;%0A%09%09%09
+seeds: seeds,%0A%09%09%09%09leech: leech,%0A%09%09%09%09downloads: downloads,%0A%09%09%09%09size: size,%0A%09%09%09%09trusted: trusted%0A%09%09%09%7D;%0A%09%09%09%0A%09%09%09console.log(item);
 %0A%09%09%09

add more informations to api