Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

Newzbin Tools

Collection of enhancements to newzbin.com (v1.0.1)

Set of tools for newzbin.com.

Tools:
* Direct nzb link
* Direct nzb w/o pars link
* External link rating fetcher (ie. get imdb score and display in list)
* in-page nfo viewer
* Quick bookmarker (thanks William C)

*Updated 12/29/05 -* Updated script to work with FF 1.5 and the newer versions of greasemonkey.

*Updated 04/26/06 -* Updated script to integrate William C's no-popup bookmarker. Thanks for addon! I've also relieved some of the browser hang when the script runs.




Feb 24, 2007
iolaus User
Here is a version that auto-lists imdb ratings and works with the new imdb: // ==UserScript== // @name Newzbin Tools // @namespace http://blah.example/greasemonkeyscripts/ // @description Collection of enhancements to newzbin.com (v1.0.1) // @include http://www.newzbin.com/* // ==/UserScript== (function() { var prefs = []; prefs["markRowAfterNZBDL"] = true; prefs["rules"] = [ ".nzbGet {display:block; float:right; font-size:xx-small;}", ".nzbGetLink {display:inline; cursor: pointer !important; color:#00008B !important; }", ".selectedRow {background-color:#6495ED !important;}", ".linkCell {color:black; display:block; font-size:6pt}", ".loadingBox {display:block;position:absolute; background-color:grey; border: solid thin lightgrey;color:white;font-size: xx-small;text-align:center}", ".nfoBox {display:block; position:absolute; border: solid 2px black; background-color: black;}", ".nfoImageBox {display:block;height: 390px; overflow: auto; background-color: white; padding: 1px;}", ".nfoToolbar {font-size: xx-small;padding: 0px 1px 1px 1px;}", ".nfoToolbarItem {font-size: xx-small; color:lightgrey !important; display:inline; padding: 0px 3px 0px 3px; cursor: pointer;};" ]; prefs["linkProcessors"] = [ new LinkProcessor(/.*imdb\.com\/title\/tt.*/, /(.*)\/10<\/b>/), new LinkProcessor(/.*gamespot.com\/.*/, /(.*)
/), new LinkProcessor(/.*tv.com\/.*/, /^\s*\s{40}(\d{1,}\.\d)$/m), new LinkProcessor(/.*ign.com\/.*/, /
<\/a><\/div>/), new LinkProcessor(/.*teamxbox.com\/.*/, /staff_score_(\d\.\d)\.jpg/), new LinkProcessor(/.*gamerankings.com\/.*/, /^(\d{2}%)$/m), new LinkProcessor(/.*gamezone.com\/.*/,/\s*(\d\.\d)\s*<\/td>/m) ]; prefs["columns"] = [ new Column(3, processLinkCell, false), new Column(4, processNfoCell, false), new Column(6, processPostCell, false) ]; function processPage() { var columns = prefs["columns"]; for (var i=0; i < columns.length; i++) { var column = columns[i]; if (column.remove == false) { processColumnCells(column.index, column.processor); } } function processColumnCells(columnNumber, cellProcessor) { var xpathQuery= "//div[@id='Content']/table[@class='dogresults']/tbody/tr[@class='new' or @class='odd' or @class='even']//td[" + columnNumber + "]/a"; var cells = evaluateXPath(unsafeWindow.document, xpathQuery); for (var i=0; i < cells.length; i++) { var cell = cells[i]; cellProcessor(cell); } } } function processLinkCell(cell) { //var aElement = cell.getElementsByTagName("A")[0]; var aElement = cell; if (aElement != undefined ) { var linkProcessors = prefs["linkProcessors"]; for (var i=0; i < linkProcessors.length; i++) { if (linkProcessors[i].urlRegex.test(aElement.href)) { aElement.onmouseover = linkProcessors[i].processor; aElement.onmouseover(); break; } } } } function processNfoCell(cell) { if (cell != undefined) { cell.onclick = nfoClick; } function nfoClick(event) { var url = this.href + "png/"; GM_xmlhttpRequest({ method: 'GET', url: url, headers: {'User-agent': 'Mozilla/4.0 (compatible) DN GM Script' }, onload: callback, onerror: function(res) {alert(res.statusText);} }); return false; } function callback(response) { var regex = /</form>"; var range = unsafeWindow.document.createRange(); range.setStartAfter(unsafeWindow.document.body.lastChild); var docFrag = range.createContextualFragment(foobar); // insert new fragment unsafeWindow.document.body.appendChild(docFrag); var fr = unsafeWindow.document.getElementById('submitme'+postID); statusTextNode.nodeValue = "submiting..."; fr.submit(); fr.parentNode.removeChild(fr); window.setTimeout(function(){unsafeWindow.document.body.removeChild(loadingDivElement);},1500+(fids.length*30)); }; } } function markRow(trElement) { var cells = trElement.getElementsByTagName("td"); for (var i=0; i < cells.length; i++) { cells[i].className="selectedRow"; } } function evaluateXPath(aNode, aExpr) { //var xpe = new XPathEvaluator(); var nsResolver = function (prefix) { return 'http://www.w3.org/1999/xhtml';}; var result = unsafeWindow.document.evaluate(aExpr, aNode, nsResolver, XPathResult.UNORDERED_NODE_ITERATOR_TYPE , null); var found = []; while (res = result.iterateNext()) found.push(res); return found; } function findPosX(obj) { var curleft = 0; var currentObject = obj; if (currentObject.offsetParent) { while (currentObject.offsetParent) { curleft += currentObject.offsetLeft currentObject = currentObject.offsetParent; } } return curleft; } function findPosY(obj) { var curtop = 0; var currentObject = obj; if (currentObject.offsetParent) { while (currentObject.offsetParent) { curtop += currentObject.offsetTop currentObject = currentObject.offsetParent; } } return curtop; } //Thanks Gmail Tweaks function initializeStyles() { var styleNode = unsafeWindow.document.createElement("style"); unsafeWindow.document.body.appendChild(styleNode); styleSheet = unsafeWindow.document.styleSheets[unsafeWindow.document.styleSheets.length - 1]; var rules = prefs["rules"]; for (var i=0; i < rules.length; i++) { styleSheet.insertRule(rules[i], 0); } } function removeColumn(colNums) { var cellsToRemove = []; for (var i=0; i < colNums.length; i++) { var colNum = colNums[i]; var cells = evaluateXPath(unsafeWindow.document, "//div[@id='Content']/table[@class='dogresults']/tbody/tr[@class='new' or @class='odd' or @class='even' or @class='header']/*["+colNum+"]"); for (var j=0; j < cells.length; j++) { cellsToRemove.push(cells[j]); } } for (var j=0; j < cellsToRemove.length; j++) { cellsToRemove[j].parentNode.removeChild(cellsToRemove[j]); } } /* * Link Processor */ function LinkProcessor(urlRegex, pageRegex) { this.urlRegex = urlRegex; this.processor = function(event) { var aElement = this; aElement.onmouseover = undefined; var callbackfunc = function(res) { if (res.status == 200) { var matches = pageRegex.exec(res.responseText); var text; if (matches != null) { text = matches[1]; } else { text = "??"; } var divElement = unsafeWindow.document.createElement("div"); divElement.setAttribute("style", "color:black; display:block; font-size:xx-small"); divElement.appendChild(unsafeWindow.document.createTextNode(text)); aElement.parentNode.appendChild(divElement); } } GM_xmlhttpRequest({ method: 'GET', url: aElement.href, headers: { 'User-agent': 'Mozilla/4.0 (compatible) DN GM Script' }, onload: callbackfunc, onerror: function(res) { alert(res.statusText); } }); }; } /* * Column */ function Column(index, processor, remove) { this.index = index; this.processor = processor; this.remove = remove; } initializeStyles(); processPage(); })();
 
Nov 30, 2006
Randall_Lind User

Please make a v3.newsbin.com one. Newzbin.com is about to go away I am guessing. They are about to launch the new watchdog for v3 and do away with it for newzbin.com so we need this updated ASAP.

I am not a programmer or understand how to edit scripts or I would.

 
Sep 16, 2006
DReAMBOXeR User

Loved this script. Please make a v3 Version - pleeeeeease!!

The most important would be INSTANT NZB Download!

Really appreciate it!

 
Aug 10, 2006
mar 1 Scriptwright

V3 update would be great. I love these things and hate it that they don't work on V3.

 
Aug 4, 2006
JS-80907 User

Very useful! At some point maybe you can update it for the new version 3 interface being tested on v3.newzbin.com.

 
Jun 24, 2006
William C Scriptwright

I just had to download this again after formatting my computer. I tried for a week or so to get by without it, but it's just WAY too useful. Thanks again for the great script.

 
May 17, 2006
mar 1 Scriptwright

got it working now. Had to completely uninstall firefox and then delete my mozilla folder and it worked :)

 
May 16, 2006
mar 1 Scriptwright

can't seem to install this and I'm not sure why anymore. I've uninstalled all my extensions in case one of them was interferring with it and still get this.
http://img129.imageshack.us/img129/9012/desktop...

 
May 5, 2006
William C Scriptwright

I still use this constantly! Thanks again for the great script, and no sweat on the little addon I did. It didn't take long at all. Oddly, I almost never use bookmarking now.

 
Apr 26, 2006
j20x6 Script's author

Tigggger, I'll have to think about your suggestions. Both are great ideas, but I don't know if I want to integrate them into this script. I think it would be more appropriate to create a new greasemonkey script for each one.

 
Apr 19, 2006
Tigggger User

Another major annoyance with newzbin is the watchdog page were you have to manually reset each item individually, is it possible via this script to add a 'reset all' function ?

 
Apr 18, 2006
Tigggger User

Thanks to the author for a great script, and to william c for the extra little bits of code, the popup killer on bookmarks is excellent. would it possible to add this functionality on an individual post page when using the 'add to bookmarks' link ?

 
Feb 5, 2006
William C Scriptwright

Hmm, thought it would be harder to do the bookmark page than it was. Here's my change for that:

Add //
prefs["bookmarkColumns"] = [
new Column(1, processPostCell, false)
];
// after prefs["columns"] and //
var bookmarkColumns = prefs["bookmarkColumns"];
for (var i=0; i < bookmarkColumns.length; i++) {
var bookmarkColumn = bookmarkColumns[i];
if (bookmarkColumn.remove == false) {
processBookmarkColumnCells(bookmarkColumn.index, bookmarkColumn.processor);
}
}

function processBookmarkColumnCells(columnNumber, cellProcessor) {
var xpathQuery= "//div[@id='Content']//form[@id='FavPosts']/table[@class='generic']//tr//td[" + columnNumber + "]/a";
var cells = evaluateXPath(unsafeWindow.document, xpathQuery);
for (var i=0; i < cells.length; i++) {
var cell = cells[i];
cellProcessor(cell);
}
}
// before function processColumnCells. I must say you've done an amazing job with that code. It's very concise and still easy to read.

 
Feb 5, 2006
William C Scriptwright

I thought the non-popup bookmark would be pretty useful to me, so I modified your script for it. I hope you don't mind.
\\
new Column(10, processBookmarkCell, false)
\\
should be added to prefs["columns"] and
\\
function processBookmarkCell(cell) {
if (cell != undefined) {
cell.onclick = bookmarkClick;
}

function bookmarkClick(event) {
var url = this.href;
GM_xmlhttpRequest({
method: 'GET',
url: url,
headers: {'User-agent': 'Mozilla/4.0 (compatible) DN GM Script' },
onload: bookmarkCallback,
onerror: function(res) {alert(res.statusText);}
});
if (prefs["markRowAfterNZBDL"]) markRow(this.parentNode.parentNode);
return false;
}

function bookmarkCallback(response) {
// Nothing here.
}
}
\\
should be added somewhere in the code. I used backslashes to seperate the code from the text, because I know it'll scrunch it on these comments.

 
Feb 4, 2006
William C Scriptwright

Since we're on the topic of bookmarks... Can you add direct DL links to the bookmark page, too? This would be amazingly handy for me.

 
Jan 27, 2006
j20x6 Script's author

DReAMBOXeR: I don't really use the bookmark feature... I didn't realize how annoying it is! It shouldn't be that hard, so check back within a week or so and a new version should be up.

 
Jan 21, 2006
DReAMBOXeR User

This is a wonderful Script! Thank you very much!

I was wondering if you might be able to add another feature:

The most annoying thing about Newzbin is the bookmark popup. Is it possible to add bookmarks and then simply highlight them, just the way you are doing with the direct download color change of the table row?

Keep up the good work! It IS appreciated!

Best regards

 
Jan 2, 2006
Robo2k User

Also, rankings from IMDB working as is the nfo viewer. So no idea what the error message is from?

 
Jan 2, 2006
Robo2k User

Update working for nzb downloading :)
Thanks m8.

Still getting -
Error: Component is not available Source File:
Line: 24
Source Code: 24

 
Dec 16, 2005
Tom P User

still not working for me either...any help :)

~Tom

 
Dec 12, 2005
Jon 2 User

It says the script was last updated on December 12, 2005, but it still doesn't work?

 
Dec 5, 2005
Robo2k User

Tried making your changes, but I'm getting this error message -

Error: Component is not available
Source File:
Line: 71
Source Code:
71

 
Dec 5, 2005
scottt732 User

Okay.. that didn't format the way I wanted to. Basically, comment out line 37 (new Column(4, processNfoCell, false)) by putting // at the beginning. Comment out line 256 (var xpe = new XPathEvaluator()) with // at the beginning of the line. Change line 258 to read: "var result = document.evaluate(aExpr, aNode, nsResolver, 0, null);" (without the quotes). Sorry.. NFO links are broken as are the w/o pars links.

 
Dec 5, 2005
scottt732 User

To get this barely working in FFox 1.5, I needed to install GreaseMonkey 0.6.4, edit the script and make the following changes:

// Because processNfoCell isn't working
// new Column(4, processNfoCell, false),

and change the evaluateXPath function:
function evaluateXPath(aNode, aExpr) {
var found = [];
var nsResolver = function (prefix) { return 'http://www.w3.org/1999/xhtml';};
var result = document.evaluate(aExpr, aNode, nsResolver, 0, null);
while (res = result.iterateNext())
found.push(res);
return found;
}

The NFO feature doesn't work, nor do the get w/o pars links, but the normal get links do.

The java console had a problem creating a new XPathEvaluator (says XPathEvaluator is not a constructor), and creating a new DOMParser (DOMParser is not an object).

 
Dec 2, 2005
SKing User

Will second the comment on updating this script. I love it and use it all the time. Wish I was smart enough to fix it.

You could comment on this script if you were logged in.