Web UI add on: Add Torrent userscript

Suggestions and discussion of future versions
klub
New User
New User
Posts: 3
Joined: Mon Nov 23, 2009 8:27 am

Web UI add on: Add Torrent userscript

Postby klub » Mon Nov 23, 2009 8:44 am

Hello,

first, congrats for the new 1.2 version. The web ui seems to be really well finished.

With the 1.1 version, I used a javascript plugin which allowed me to simply add torrent to my distant deluge server through the webui: http://userscripts.org/scripts/show/12639

However, the link used to add the torrent does not work anymore. To add a torrent, the plugin add a link on the torrent page a link to my server, e.g.:

Code: Select all

http://myserver.org:9112/torrent/add?redir_after_login=1&url=http%3A//www.mininova.org/get/123456


Maybe I am wrong, but I think this "add" page was not designed to work for this kind of request. Anyway, it worked well. I scanned along the webui source code, but I could not find anything similar (I am not familiar with Ajax code).

Do you have any idea for a similar address access to the deluge web server, and if not, is it difficult to add?

Thanks,

Jérôme

aidos
Member
Member
Posts: 20
Joined: Tue Nov 24, 2009 9:58 pm

Re: Web UI add on: Add Torrent userscript

Postby aidos » Wed Nov 25, 2009 12:09 am

Hello Jérôme,

I patched (quite heavily) the script you refer to for my own purpose, and to adapt it to the latest WebUI.
It's attached to this reply if you're interested. It's in no way a work of art, but I'm no JS developper :)

Enhancements more than welcome!

[Edit]
Latest version of the script is at : http://userscripts.org/scripts/show/79003
Last edited by aidos on Sun Jun 13, 2010 2:01 am, edited 2 times in total.

waeking
Member
Member
Posts: 16
Joined: Wed Nov 25, 2009 9:37 pm

Re: Web UI add on: Add Torrent userscript

Postby waeking » Wed Nov 25, 2009 10:09 pm

This new one is great I am so looking forward to this working. I have edited in the user information. When I open a torrent page (have tried a few different ones) the blue deluge symbol is present (not the blue/green "active" symbol). When I click on the symbol it turms the symbol to a grey flashing bar (I am not sure if this is the "loading" or "error" symbol. I have tried this script in both Firefox and Safari.

I am not a java designer/editor but I have been looking through the java script. I have noticed between the old webui and this new one there is a difference. In the old web ui:

Code: Select all

"+host+"
where as in the new web ui

Code: Select all

" + host + "
. Same as for the port. I have edited this in the new web ui to change to the old "standard" however this does not make a difference. I do not understand fully how this script works to go much further.

klub
New User
New User
Posts: 3
Joined: Mon Nov 23, 2009 8:27 am

Re: Web UI add on: Add Torrent userscript

Postby klub » Mon Nov 30, 2009 8:22 am

Hello Aidos,

your patch works like a charm! You should consider to propose it to the original author, and if you have no response, add yours to userscript.org.

Anyway, good job! Thanks a lot.

waeking
Member
Member
Posts: 16
Joined: Wed Nov 25, 2009 9:37 pm

Re: Web UI add on: Add Torrent userscript

Postby waeking » Mon Nov 30, 2009 7:54 pm

hmm wonder why it doesn't work. I am running Snow Leapord to use the webui. The deluge server runs on a ubuntu 8.04 box. I am running deluge 1.2.0-rc3 using twisted 8.2.0. I wonder what other information would be useful.

klub
New User
New User
Posts: 3
Joined: Mon Nov 23, 2009 8:27 am

Re: Web UI add on: Add Torrent userscript

Postby klub » Tue Dec 01, 2009 8:38 am

waeking wrote:hmm wonder why it doesn't work. I am running Snow Leapord to use the webui. The deluge server runs on a ubuntu 8.04 box. I am running deluge 1.2.0-rc3 using twisted 8.2.0. I wonder what other information would be useful.


I don't know about MacOS, but on Linux the deluge package has been divided into several ones. You must now launch deluged AND deluge-webui. Did you fill the datas required at the beginning of the .js file: host, port and password?

aidos
Member
Member
Posts: 20
Joined: Tue Nov 24, 2009 9:58 pm

Re: Web UI add on: Add Torrent userscript

Postby aidos » Tue Dec 01, 2009 10:27 am

Thanks klub :) glad you like it, I know I do, I think it has become so easy to add a torrent, that I click on them far more than before :D
You're right I'll send it to the original author.

waeking : The grey bar not doing anything but bouncing back and forth usually means the script cannont contact the WebUI server. Are you sure you set it up properly ? Also, The code samples you refer to are strictly identical from the computer's point of view, it ignore whitespaces. So if a bug there is, it's not there :)

I have the same setup as you except it's ubuntu 9.04 on my server. I have snow leopard too. So it should work.

waeking
Member
Member
Posts: 16
Joined: Wed Nov 25, 2009 9:37 pm

Re: Web UI add on: Add Torrent userscript

Postby waeking » Tue Dec 01, 2009 3:18 pm

aidos.... thanks for replying. I redownloaded the script and went through the whole process again. This time it worked like a peach. I compared my old script to the new one, however I don't know where the difference lies. But I love this. Everyone will be using this before you know it. Just need to get greasemonkey working on Windows Mobile. But thats another story..... Thanks soo much.

Only one thing to improve in a later revision... Once the button has bee clicked. the page reverts to the top. I would be nice if the page would stay in the same place. So that a person does not have to scroll down and find where one was. But this is just like a wish list. I really do appreciate all of the work that went into this.

EDIT: I should add that this script works in firefox. However I cannot seem to get the script to work with greasekit 1.7 in safari 4.0.4. I have read that safari deals with javascript in a different way, meaning that alot of complex javascripts will not work correctly in safari.

aidos
Member
Member
Posts: 20
Joined: Tue Nov 24, 2009 9:58 pm

Re: Web UI add on: Add Torrent userscript

Postby aidos » Tue Dec 01, 2009 4:00 pm

Glad it works for you!
Concerning the scroll to top, yeah, it's fixed in my copy ;) So I'll upload an updated version later tonight if I don't forget.

aidos
Member
Member
Posts: 20
Joined: Tue Nov 24, 2009 9:58 pm

Re: Web UI add on: Add Torrent userscript

Postby aidos » Tue Dec 01, 2009 9:44 pm

Ok, updated the original attachement above (I figured people wouldn't scroll down this thread to get the latest version, lazy as they are ;) )


Return to “Development”

Who is online

Users browsing this forum: No registered users and 3 guests