Page 1 of 1

[WINDOWS] Twitter Notifications

Posted: August 25th, 2014, 4:46 pm
by mookydudz
Hi All

I found a few guides based on *nix to get SAB to send tweets to notify you of its status. I couldn't find any for windows so I cobbled this together.

***DISCLAIMER***
I am not a software dev, coder or programmer. Everything below you do at your own risk. Please don't flame me, it works on my install.

***Credits***
Nick Gordon creator of "twt"

I have written a script that uses "twt" to send tweets from the command line to twitter. In my setup, i have a private 2nd twitter account that only my main twitter account has followed.

1. Download "twt" from https://code.google.com/p/twt/

2. Extract "twt" to a folder on your HDD (I've extracted to C:\twitter\)

3. Open a command prompt & navigate to your extracted "twt" location (cd C:\twitter\)

4. In command window execute:

Code: Select all

twt -config
5. This will launch a browser window. Log in to your 2nd twitter account & you will be given a pin number to enter into the dialog box.

6. When you have entered the pin, a config file will be created at C:\twitter\

7. Open notepad, copy & paste the following:

Code: Select all

CLS
SET status=%7
SET zero=0
SET filename=%3
IF %status% EQU %zero% (GOTO :SUCCESS) ELSE (GOTO :FAIL)
:SUCCESS
SET msg=Sabnzbd - Successfully downloaded %filename%
C:\twitter\twt -q %msg%
EXIT
:FAIL
SET msg=Sabnzbd - Failed to download %filename%
C:\twitter\twt -q %msg%
EXIT
8. Save as "SAB2TWIT.bat"

9. Move your "SAB2TWIT.bat" file to your post processing scripts folder.

10. Assign this to any category you wish.

I have only tested this on a few files & it seems to be working. Feel free to share & improve.

Please post your improvements here so i can make use of them as my scripting knowledge is very limited.

Re: [WINDOWS] Twitter Notifications

Posted: October 18th, 2014, 12:17 am
by drizzt09
AWESOME, I have been waiting for this for quite some time. It used to work perfectly until Twitter disabled API 1.0.

This works like a charm. Thank you.

I did make a slight modification:

Code: Select all

CLS
SET status=%7
SET zero=0
SET filename=%3
IF %status% EQU %zero% (GOTO :SUCCESS) ELSE (GOTO :FAIL)
:SUCCESS
SET msg=d PersonalTwitterUser Download Complete: %filename%
C:\Twitter\twt -q %msg%
EXIT
:FAIL
SET msg=d PersonalTwitterUser Download Failed: %filename%
C:\Twitter\twt -q %msg%
EXIT
Replace "PersonalTwitterUser" in the to lines with your public account username. This way the secondary account DMs your other account and noone else can see it... any you get notified for DMs.

thanks again

Re: [WINDOWS] Twitter Notifications

Posted: January 18th, 2015, 5:49 pm
by Richard63
Hello
I tried to use this script to send notifications to KODI (xbmc) but script hangs. i have to exit sab to kil it.

when i use the notifi comand in dos, it works!

Can someone help me ?

Code: Select all

CLS
SET status=%7
SET zero=0
SET filename=%3
IF %status% EQU %zero% (GOTO :SUCCESS) ELSE (GOTO :FAIL)
:SUCCESS
SET msg=Sabnzbd - Successfully downloaded %filename%

"C:\Program Files (x86)\SABnzbd\scripts\notify.exe" \"%msg%\" \"Test Geslaagd!!!\" 192.168.2.4

EXIT

:FAIL
SET msg=Sabnzbd - Failed to download %filename%
"C:\Program Files (x86)\SABnzbd\scripts\notify.exe" \"%msg%\" \"Test Geslaagd!!!\" 192.168.2.4
EXIT