Bookmarklet for Binsearch to sabnzbd (works for iPad, iPhone, etc...)

Got a program that plays well with SABnzbd? Share it here!
Post Reply
TracerX
Newbie
Newbie
Posts: 4
Joined: May 3rd, 2009, 11:16 pm

Bookmarklet for Binsearch to sabnzbd (works for iPad, iPhone, etc...)

Post by TracerX »

I wanted a quick way to send nzb's from binsearch.info to my sabnzbd server from my iPad so I whipped up a bookmarklet to handle this task. Please note that this bookmarklet should be considered alpha so if your computer and/or device should melt down after using it don't hold me responsible. To use this bookmarklet:
1) Copy the code below to a text editor and edit the first four variables (apikey,sabnzbdserver,useSSL, and defaultCat) to your liking
2) Paste the edited code into the script box at http://userjs.up.seesaa.net/js/bookmarklet.html
3) Change the title of the script to whatever you'd like on the page
4) Bookmark the link at the bottom of the screen.

This has been tested with iPad, iPhone, Firefox and Safari. This code was developed using pieces from this greasemonkey script. Many thanks to the author of this script. YMMV!

Code: Select all

(function () {
    var apikey = 'ENTER_API_KEY_HERE';
    var sabnzbdserver = 'ENTER_SABNZBD_SERVER_ADDRESS_HERE(e.g. 192.168.1.1:9090)';
    var useSSL = true;
    var defaultCat = 'tv';
    var checked_ids = new Array();
    var nzbName = '';
    var cat = prompt('Please enter the category for this nzb.', defaultCat);
    var NZBcheckboxes = document.evaluate('//input[@type="checkbox"]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    for (var j = 0; j < NZBcheckboxes.snapshotLength; j++) {
        if (NZBcheckboxes.snapshotItem(j).checked == true) {
            checked_ids.push(NZBcheckboxes.snapshotItem(j).name + '=1');
        }
    }
	var str=location.search.match(/\bq\= *([^\&]+)/);
	nzbName=str[1];
	nzbName = prompt('Please enter the name for this nzb.', nzbName);
    if (cat != '') {cat = 'cat=' + cat + '&';}
    var transport = 'http://';
    if (useSSL) {transport = 'https://';}
    if (nzbName != '') {
        window.open(transport + sabnzbdserver + '/sabnzbd/api?mode=addurl&apikey=' + apikey + '&nzbname= ' + escape(nzbName) + '&' + cat + 'name=' + escape('https://www.binsearch.info/?action=nzb&' + checked_ids.join('&')));
    } else {
        window.open(transport + sabnzbdserver + '/sabnzbd/api?mode=addurl&apikey=' + apikey + '&' + cat + 'name=' + escape('https://www.binsearch.info/?action=nzb&' + checked_ids.join('&')));
    }
})()
EDIT: Fixed issue with code. If you've created a bookmarklet that isn't working, try recreating with this code.
Last edited by TracerX on August 10th, 2010, 1:20 pm, edited 1 time in total.
User avatar
rascalli
Moderator
Moderator
Posts: 656
Joined: January 18th, 2008, 12:30 am
Location: Bossche bollen land

Re: Bookmarklet for Binsearch to sabnzbd (works for iPad, iPhone, etc...)

Post by rascalli »

maybe advise how it works, and what to do after you made the bookmarklet.

So noobs with this like me know what to do  ;D ;D
TracerX
Newbie
Newbie
Posts: 4
Joined: May 3rd, 2009, 11:16 pm

Re: Bookmarklet for Binsearch to sabnzbd (works for iPad, iPhone, etc...)

Post by TracerX »

Oh yea, I suppose that would be helpful huh? (oops!)

Once you have the bookmarklet installed, go to binsearch, search for something, and put checkmarks next to what you want to download (just as if you were getting ready to download an nzb from them using the standard method). Once you have done this, click on the bookmarklet and it should ask you for a category (it will default to whatever you have in the defaultCat variable), a name (it will default to whatever the search term you used was) and it will then send the selected items to your sabnzbd queue.
arto65
Newbie
Newbie
Posts: 35
Joined: July 26th, 2010, 3:05 am

Re: Bookmarklet for Binsearch to sabnzbd (works for iPad, iPhone, etc...)

Post by arto65 »

Hello TracerX!
Have you seen the app SABcommand for iPad ? Alright it's 2.39€/2.99$ but it works really well. In landscape mode, you have two panes:
- On the right pane a browser to look for and download your NZBs from your preferred sites
- On the left pane, all the details about your downloads: download speed, queue, history, disk space....

There's also myNZB that works on iPhone and iPad. Works with few nzb search engines.

If you insist your solution to be free, you can use RSS feeds or a cloud-synced folder to upload NZBs with services like Dropbox (and yes, you can do that on an iPad/iPhone).
NK26
Newbie
Newbie
Posts: 19
Joined: May 19th, 2010, 8:39 pm

Re: Bookmarklet for Binsearch to sabnzbd (works for iPad, iPhone, etc...)

Post by NK26 »

This could really come in handy thanks very much!
TracerX
Newbie
Newbie
Posts: 4
Joined: May 3rd, 2009, 11:16 pm

Re: Bookmarklet for Binsearch to sabnzbd (works for iPad, iPhone, etc...)

Post by TracerX »

Hope it does NK26.

I am aware of the program alternatives arto65 but I prefer binsearch which isn't supported by any of the iPhone/iPad options (that I've found). I thought about dropbox but you can't download nzb files on an iPhone/iPad and sync them (easily) that I've found. At the end of the day it all comes down to personal preference but I agree everyone should be aware of all the options!

Hopefully this could lead to some of the iPhone/iPad apps adding this option.
User avatar
nomar383
Release Testers
Release Testers
Posts: 221
Joined: April 14th, 2010, 1:34 am
Location: Rexburg, ID
Contact:

Re: Bookmarklet for Binsearch to sabnzbd (works for iPad, iPhone, etc...)

Post by nomar383 »

SABCommand for the iPad has bookmarking capabilities for websites built-in. Which means it should work fine with this script if I'm reading the setup instructions correctly.

EDIT: As long as there are no double-quotes or any characters that would be need to be escaped in an NSString (which is how bookmarks are stored)
Last edited by nomar383 on August 14th, 2010, 11:20 pm, edited 1 time in total.
SABCommand for iPad Developer
SABConnect for Safari 5 Developer

Bug Tracking:
http://redmine.kalenhansen.com

Twitter:
http://twitter.com/SABCommand
arto65
Newbie
Newbie
Posts: 35
Joined: July 26th, 2010, 3:05 am

Re: Bookmarklet for Binsearch to sabnzbd (works for iPad, iPhone, etc...)

Post by arto65 »

Hey, TracerX,
Sorry, I've been a little slow to respond.
1) I will check, but I'm pretty sure SABcommand works with binsearch.
2) If you want an easy way to send NZB to your dropbox folder, there's an app for that ;-): "Filer". It can download files and sync with Dropbox. You can either use their built-in browser of use their bookmarklet to send links from Safari to Filer.
BTW, Filer can extract .zip, .rar (even multi-rar or password protected).

I prefer using SABcommand, because you keep control over sabnzbd+. Of course you can still use the webinterface in your browser.

PS: do anyone have an idea why binsearch is down these days ?
Post Reply