Closed drizzt09 closed 6 years ago
I'll see how difficult it is and hopefully have a look at it this weekend. Since Twitter restricts you to 140 characters or less. Space is somewhat very limited, what did you want to be displayed inside the tweet?
Successful or failed download and file name. I had it DM from 1 twitter account to another twitter account. DM do not have character limits. Also regular tweets are in the process of increasing to 280 characters. Started rolling out last week on a staged roll out. Another option is supporting zapier. It is designed to connect apps. If you can hook into zapier, zapier can fees twitter (and thousands of other apps)
Thanks for your feedback! So do you think this new enhancement should provide both public tweets and DMs, or just DMs?
I'm thinking just private DMs might be the best way to go? What are your thoughts?
Meanwhile I'll investigate zapier (as you mentioned) and other frameworks and see what can be put together.
I personally prefer DM but having two command strings (one for each) would give user options which options are always great. We use Zapier at work to take specific emails and post to Ryver (Slack competitor). You get 5 zaps in a free account
I think i just completed the task! :smile:. Have a go at the master branch and let me know how it goes.
The syntax is: tweet://user@/ConsumerKey/ConsumerSecret/AccessTokenKey/AccessTokenSecret/
This is presuming you set up yourself an app correctly on https://apps.twitter.com and generated you a set of Access Tokens!
I was able to send myself a Direct Message (i have not added public tweets yet). If i do implement it, the syntax will be the same, but you'll add ?public=True to the end of the URL.
At this point, I'll just be curious to hear your feedback!
wow that was fast. thanks. OK, created my app and got all keys needed downloaded and extracted master branch into scripts folder selected notify.py and put in the parameters based on the above string with my own info saved but when running test get error: Notification script returned exit code 1 and output "'python' is not recognized as an internal or external command, operable program or batch file. "
Question is the section for "user@". Is it supposed to be replaced with "@user" or just "user" and is it sending user or receiving user?
For SABnzbd you want to choose the special wrapper script (sabnzbd-notify.py); but Notify.py and the Notify directory both need to be present too (all in the same directory).
Then when you fill out the Notification argument, you'll need to put tweet://user@/ConsumerKey/ConsumerSecret/AccessTokenKey/AccessTokenSecret/ in the field. You'll need to substituting all the values with what you got from Twitter.
The user can be your twitter identifier (without the @ symbol in front of it) or it can be the Owner Identifier which you can find out from the same screen your Keys are located at. I realize this seems backwards for twitter, but it's actually the correct syntax for a web page URIs.
If you have access to a terminal, you can change to the directory/of/sabnzb/scripts/ and type:
# Test your command manually (without SABnzbd)
python Notify.py -s tweet://user@/ConsumerKey/ConsumerSecret/AccessTokenKey/AccessTokenSecret/
# Or, do the same command with the -D switch to see more debugging information that
# may or may not help you, but it may help me (if you belive the problem is still in the script)
python Notify.py -D -s tweet://user@/ConsumerKey/ConsumerSecret/AccessTokenKey/AccessTokenSecret/
fixed the script, selection, changed the user which i had a different user. Now i have the user that belongs to the keys. I used CMD in Windows to run your command but get error there too (which i assume is because im on Windows?): 'python' is not recognized as an internal or external command, operable program or batch file.
Weird, SABnzbd relies on Python, does it not? You could make sure it's a part of your Windows installation; get it here. Then giver another go! :)
ok, python installed. python install directory added to windows path. now python recognized in CMD. Running your command gives a different error now. a bunch of lines with my keys and then ends with: 2017-10-05 22:55:09,496 - 9124 - ERROR - Could not initialize tweet instance. 2017-10-05 22:55:09,513 - 9124 - DEBUG - Initialization Exception: No user was specified. 2017-10-05 22:55:09,513 - 9124 - DEBUG - Exiting with return code: 0
But i had python Notify.py -D -s tweet://sickbeard9/key/secret/key/secret
Server parsed to: {'host': 'sickbeard9', 'user': None, 'query': None, 'url': 'tweet://sickbeard9/ is the user going into the wrong field? seems like it thinks the user is the host and the user is blank
I restarted the PC and test passed in Sab, but nothing arrived in Twitter.
I ran an actual download and automated the script and got this:
2017-10-06 00:10:52,345 - sabnzbd-notify - 6976 - ERROR - Invalid
but same error as before from CMD: 2017-10-06 00:16:38,447 - 5876 - DEBUG - Server parsed to: {'host': 'sickbeard9', 'user': None, 'query': None, 'url': 'tweet://sickbeard9/ConsumerKey/ConsumerSecret/AccessTokenKey/AccessTokenSecret/', 'path': '/ConsumerKey/ConsumerSecret/AccessTokenKey/AccessTokenSecret/', 'fullpath': '/ConsumerKey/ConsumerSecret/AccessTokenKey/AccessTokenSecret/', 'password': None, 'port': None, 'qsd': {}, 'schema': 'tweet'} 2017-10-06 00:16:38,447 - 5876 - ERROR - Could not initialize tweet instance. 2017-10-06 00:16:38,447 - 5876 - DEBUG - Initialization Exception: No user was specified. 2017-10-06 00:16:38,447 - 5876 - DEBUG - Exiting with return code: 0
But i had python Notify.py -D -s tweet://sickbeard9/key/secret/key/secret
Your problem is here. Try this instead
# Note that the user you dm (sickbeard9 in this case)
# must have an @ symbol following it, not a slash (/)
Notify.py -D -s tweet://sickbeard9@key/secret/key/secret
Thanks. Made the switch. Passed all tests. Will know for sure once something downloads.
ok downloads work, get the DM successfully.
everything in Sab completes but it gives an error even though it worked. Looks like Sab is complaining about the format?
2017-10-06 20:44:23,622 - sabnzbd-notify - 5980 - ERROR - Invalid
Hmm, this is really weird... so first it works... but then it spits out an error that it didn't 😕
What version of SABnzbd are you using? 2.3.0?
What do you have in the other Notify.py fields? Perhaps you have a space somewhere or more content in your Arguments entry? It accepts more then one (so you can notify more then 1 thing) if you just keep adding more urls. Perhaps there is a bad url at the end?
I might need more time to figure this out because you have me scratching my head. Hopefully I'll have figured it out sometime this weekend. Do you have any other details you can throw at me while i try to reproduce this? Anything at all is useful at this point...
I have no other strings in that parameter field. I will check for spaces at beginning or end but it looks like it's complaining about a comma which ibdont have. I have all other notification options off. Only have complete and failed downloads checked. Yes version 2.3 64bit. On win10
I'm unable to reproduce your problem at all. I keep getting all of the notifications as expected (just like you said you are). But the difference is, I don't see any errors in my logs. ☹️
One thing you could do is:
The fact that the main notifications are working tells me that SABnzbd just isn't passing in the correct parameters for some strange scenario. I have to assume that your logs have a lot of successful notification messages surrounding the one your inquiring about?
thanks for the help and it has been working perfectly since. I finally got around to adding a post in Sab forums https://forums.sabnzbd.org/viewtopic.php?f=9&t=23022 Busy here with Canadian thanksgiving
I'm from Canada too! Happy Thanksgiving! :smile:
I'm going to close off this ticket now. Feel free to reopen it or create another if you have any more questions or issues!
solved the issue on the SAb forums. I had set NZB-notify both as a post processing script and as a notification script. post was the one it was failing on.
Did you look into Zapier? https://zapier.com/app/explore
Briefly, i ended up solving your request using another library that gives you unlimited posts to Twitter. But i did check Zapier out! It looks like they have lots of apps they can plug you into!
I used to use a twitter notification setup from this url https://forums.sabnzbd.org/viewtopic.php?f=9&t=17999&p=98578&hilit=twitter#p98578 but this past week it has stopped working with error: Notification script returned exit code 255 and output " C:\Program Files\SABnzbd>CLS C:\Program Files\SABnzbd>SET status= C:\Program Files\SABnzbd>SET zero=0 C:\Program Files\SABnzbd>SET filename="Test Notification" 0 was unexpected at this time. C:\Program Files\SABnzbd>IF EQU 0 (GOTO :SUCCESS) ELSE (GOTO :FAIL) " Would be excellent if your awesome notify service could include twitter