iPhone notification via Prowl [Windows script]

Come up with a useful post-processing script? Share it here!
relman
Release Testers
Release Testers
Posts: 46
Joined: September 30th, 2008, 2:42 am

iPhone notification via Prowl [Windows script]

Post by relman »

Hi Everyone,

Firstly thanks to the poster for the iPhone notification via Prowl post. When I saw this I did some google searches and found out what a great idea this was. So as I run SABnzbd on a Win32 box and really have no idea about python I decided to write a CMD and VBS file to do the job, so far all works great and now all my download notifications are getting pushed to my phone. 

Before you install the script make sure you get the Prowl app for the iphone. £1.79 in the UK

There are 2 parts. firstly the CMD (batch file) which is used by windows sabnzbd this basically takes the info from sabnzbd and makes the vbscript file run. The second part is the vbscript.

Part 1.

Below is the CMD file, copy the file and paste into notepad and save as prowl.cmd . Make sure you change to your prowl API key. and make sure the location set for the prowl.vbs file is correct.

Code: Select all

set API="<Put API Key here>"

Set Item=%3
setlocal enableextensions
set var_=%Item%
set var_=%var_:=†%
set var_=%var_:Ž=„%
set var_=%var_:™=”%
set var_=%var_:"=%
set var_=%var_:!=%
set var_=%var_:_= %
set var_=%var_:;= %
set var_=%var_::= %
set var_=%var_:'= %
set var_=%var_:,= %
endlocal & set ItemConvert=%var_%
Set ItemConvert= "%ItemConvert%"
set priority=2
set desc=%ItemConvert%

cscript C:\downloads\temp\scripts\prowl.vbs %API% %priority% %desc%
Part 2.

Below is the VBScript. Copy and paste this into notepad and save as prowl.vbs and place in script folder with above CMD file.

Code: Select all

API = WScript.Arguments.Item(0)
priority = WScript.Arguments.Item(1)
desc = WScript.Arguments.Item(2)

set oHTTP = CreateObject("Microsoft.XMLHTTP")  
oHTTP.open "Get", "https://prowl.weks.net/publicapi/add?" & "apikey=" & API & "&priority=" & priority & "&application=SABnzbd&event=" & Date() & " " & Time()  & "&description=" & desc ,false  
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"  
oHTTP.send  
HTTPPost = oHTTP.responseText
Now just set prowl.cmd as your default script. Everytime something downloads you will get a push message on your iphone.

To Recap

1. Create a Prowl account
2. Paste the Key into the cmd file
3. Change the path to the VBS file in the cmd file
4. Buy and install the iPhone app
5. Log in to my Prowl account through the iPhone app
6. Add the cmd file as the default script.

When editing the CMD file to add the location of the Prowl.Vbs file you will need to be careful if using a location with spaces. i.e. c:\documents and settings\.

Either enter old dos format e.g. C:\Docume~1\  or make sure the command is within speech marks.  Below are some examples using my documents as the folder with the scripts.  (C:\documents and settings\Admin\My Documents\)

cscript C:\docume~1\Admin\Mydocu~1\prowl.vbs %API% %priority% %desc%

or

cscript "C:\documents and settings\Admin\My Documents\prowl.vbs" %API% %priority% %desc%

thanks bas & vdown for feedback.
Last edited by relman on July 29th, 2009, 5:49 pm, edited 1 time in total.
bas
Newbie
Newbie
Posts: 3
Joined: July 29th, 2009, 3:57 am

Re: iPhone notification via Prowl [Windows script]

Post by bas »

He Man i installed everything correctly. But it does not work with me  :-\

Added my api key from the prowl website (via settings) and added the path to the .vcb and set the default script in sabnzbd to this folder...restarted everything. But no push on my iphone
Last edited by bas on July 29th, 2009, 4:03 am, edited 1 time in total.
vdown
Release Testers
Release Testers
Posts: 38
Joined: January 30th, 2008, 8:01 am

Re: iPhone notification via Prowl [Windows script]

Post by vdown »

That's awesome, works great. Took about 2 mins to configure.

BTW you do need the Growl iPhone app for this to work (it's £1.79 in the UK)
bas
Newbie
Newbie
Posts: 3
Joined: July 29th, 2009, 3:57 am

Re: iPhone notification via Prowl [Windows script]

Post by bas »

damn weird,  :(...did you change any settings to the growl windows program?
vdown
Release Testers
Release Testers
Posts: 38
Joined: January 30th, 2008, 8:01 am

Re: iPhone notification via Prowl [Windows script]

Post by vdown »

You don't need the Windows program installed. The script sends the notification with all the info directly to the Prowl servers.

All I did was:-

1. Create a Prowl account
2. Paste the Key into the cmd file
3. Change the path to the VBS file in the cmd file
4. Buy and install the iPhone app
5. Log in to my Prowl account through the iPhone app
6. Add the cmd file as the default script.
bas
Newbie
Newbie
Posts: 3
Joined: July 29th, 2009, 3:57 am

Re: iPhone notification via Prowl [Windows script]

Post by bas »

Yes! I find it out, the script or the code-language cant read spaces in the path... so C:/documents and settings... wil be red as C:/documents.

So i got it! Thnx dude
relman
Release Testers
Release Testers
Posts: 46
Joined: September 30th, 2008, 2:42 am

Re: iPhone notification via Prowl [Windows script]

Post by relman »

just a quick note. If you have upgraded Prowl and want to use the "quiet hours" option you might want to change the following setting in the cmd file.

set priority=2


change it to something like

set priority=0

2 means emergancy which overrides the quiet hours setting, if you set it to that is.

thanks
TheMedic
Newbie
Newbie
Posts: 1
Joined: October 3rd, 2009, 4:13 am

Re: iPhone notification via Prowl [Windows script]

Post by TheMedic »

Just registered to say a big thankyou for this - it worked first time and will come in very useful for keeping on top of SABnzbd+ whilst away from the PC!
JohnSCS
Newbie
Newbie
Posts: 42
Joined: August 17th, 2009, 12:23 am

Re: iPhone notification via Prowl [Windows script]

Post by JohnSCS »

Python script alternative.

Code: Select all

import sys,urllib

# Get clean NZB name
job_name = sys.argv[3]

# Prowl API settings - http://prowl.weks.net/api.php
# Set Prowl API
API = "<prowl api-key>"
# Set Prowl priority. 0 - Normal, 2 - Emergency, -2 - Very Low
priority = "0"

# Set job title/event name
job_title = "Download%20Complete"

# Get current date/time and strip spaces
from time import gmtime, strftime
event_time = strftime("%d/%m/%y %H:%M")
event_time=event_time.replace(' ', '%20')

# URL encode chars from NZB name that cause issues
job_name=job_name.replace(' ', '%20')
job_name=job_name.replace('_', '%20')
job_name=job_name.replace('.', '%20')

# Send download complete notification to iPhone - swap 'job_title' for 'event_time' if completion time is required instead of 'Download Complete'
urllib.urlopen("https://prowl.weks.net/publicapi/add?apikey=" + API + "&priority=" + priority + "&application=SABnzbd&event=" + job_title + "&description=" + job_name)

deedwar
Newbie
Newbie
Posts: 24
Joined: January 22nd, 2008, 6:22 am

Re: iPhone notification via Prowl [Windows script]

Post by deedwar »

thanks for the script it works perfectly
mailgoe
Newbie
Newbie
Posts: 9
Joined: October 4th, 2010, 11:58 am

Re: iPhone notification via Prowl [Windows script]

Post by mailgoe »

followed all the steps but got an error in sabnzbd:

webinterface:
Image
"Exit(1) konnte nicht gefunden werden. Mehr." means something like "Exit(1) could not be found. More."

And after a click on the link "more" i will get this:

"C:\Programme\XUL\SABnzbd>~s
Der Befehl "~s" ist entweder falsch geschrieben oder
konnte nicht gefunden werden."

means:
"C:\Program Files\XUL\SABnzbd>~s
The command "~s" is either misspelled or
could not be found."

Whats wrong with that?

EDIT: Forgot to say that I'm not working with the newest SabNZBd version, hence that's not possible for me. I'm using the WHS Add-In for SabNZBd, and that's based on SabNZBd Version 0.5.3.
Last edited by mailgoe on October 4th, 2010, 12:10 pm, edited 1 time in total.
relman
Release Testers
Release Testers
Posts: 46
Joined: September 30th, 2008, 2:42 am

Re: iPhone notification via Prowl [Windows script]

Post by relman »

can you paste the contents of the .cmd file please.
mailgoe
Newbie
Newbie
Posts: 9
Joined: October 4th, 2010, 11:58 am

Re: iPhone notification via Prowl [Windows script]

Post by mailgoe »

Code: Select all

set API="79c7bb8e283752fbc0f4b5b0fceXXXXXX"

Set Item=%3
setlocal enableextensions
set var_=%Item%
set var_=%var_:�=†%
set var_=%var_:Ž=„%
set var_=%var_:™=”%
set var_=%var_:"=%
set var_=%var_:!=%
set var_=%var_:_= %
set var_=%var_:;= %
set var_=%var_::= %
set var_=%var_:'= %
set var_=%var_:,= %
endlocal & set ItemConvert=%var_%
Set ItemConvert= "%ItemConvert%"
set priority=2
set desc=%ItemConvert%

cscript E:\usenet\scripts\prowl.vbs %API% %priority% %desc%
content of *.cmd file. Edited the api for known reasons :P
even if it#s workin now for me (with an alternative phyton script) i would like to detect the error.
simonk83
Jr. Member
Jr. Member
Posts: 69
Joined: December 11th, 2010, 3:41 pm

Re: iPhone notification via Prowl [Windows script]

Post by simonk83 »

mailgoe wrote: followed all the steps but got an error in sabnzbd:

webinterface:
Image
"Exit(1) konnte nicht gefunden werden. Mehr." means something like "Exit(1) could not be found. More."

And after a click on the link "more" i will get this:

"C:\Programme\XUL\SABnzbd>~s
Der Befehl "~s" ist entweder falsch geschrieben oder
konnte nicht gefunden werden."

means:
"C:\Program Files\XUL\SABnzbd>~s
The command "~s" is either misspelled or
could not be found."

Whats wrong with that?

EDIT: Forgot to say that I'm not working with the newest SabNZBd version, hence that's not possible for me. I'm using the WHS Add-In for SabNZBd, and that's based on SabNZBd Version 0.5.3.
I get this same error unfortunately...

C:\Program Files (x86)\SABnzbd>~s
'~s' is not recognized as an internal or external command,
operable program or batch file.

Any ideas?
simonk83
Jr. Member
Jr. Member
Posts: 69
Joined: December 11th, 2010, 3:41 pm

Re: iPhone notification via Prowl [Windows script]

Post by simonk83 »

simonk83 wrote:

C:\Program Files (x86)\SABnzbd>~s
'~s' is not recognized as an internal or external command,
operable program or batch file.
Anyone? :)
Post Reply