Forum New Posts Notifier for NiftyHost
11-16-2010, 10:48 AM, (This post was last modified: 11-16-2010, 11:43 AM by RichardGv.)
#5
RE: Forum New Posts Notifier for NiftyHost
I'm adding support for vBulletin forums and SMF forums. (By the way, I'm kind of surprised that vBulletin uses MD5 on client side when submitting password!) But the vBulletin site I'm testing on have no new posts currently, and the SMF one is totally down. :) So I need to wait for some time to do a final test.

(11-16-2010, 05:18 AM)Vanilla Wrote: But, if I may:
- It would be nice to have the login info made more visible (ie. be under some sort of settings sections/function)
- I can confirm it working partially under Windows 7 - I was able to see the latest new post/thread, but i also got an error:

The configuration is only a one-time work, so it's not too much a burden, but maybe I will consider splitting the configuration to a separate file once the script gets stable. Currently I could update the script everyday so splitting the configuration will only create more troubles when upgrading.

As for the exception, Vanilla, I thought you would at least carefully read the bold parts in my thread, but you did not, unfortunately. Your problem is caused by the default value of the option 'cmdexec', which is designed purely for Linux users instead of Windows users. I've stated that point clearly in my thread, and you did not notice it. Please read the bold part:
(11-15-2010, 08:18 PM)RichardGv Wrote: Constant 'cmdexec'. Line 21. Commands executed when a new post is discovered. You can use it to, for example, play some sound or show a libnotify popup when a new post is found. It's written in the format of a Python tuple. Examples:
(The script comes with a nice default value for Linux users, but for Windows users it will cause an exception! Windows users may change it to the blank value "cmdexec = ()".)
Code:
# No command is the best command :D
cmdexec = ()

# Attention: If there's only a single string in the tuple, you need to add an extra comma after the string.
cmdexec = ('notify-send "{site}" "{title} by {author}"', )

# The command I use:
cmdexec = (r'notify-send A\ new\ post\ in\ {site_esc} {title_esc}\ by\ {author_esc}', 'mplayer -really-quiet /usr/share/sounds/purple/receive.wav')
# {site_esc} = shell-escaped {site}. And so forth...

# An example of a command on Windows
cmdexec = (r'C:\Program Files\VideoLAN\VLC\vlc.exe C:\skyrocket_explode.mp3', )
The reason why it fails, technically, is {site_esc}, {title_esc}, and {author_esc} are all not provided for Windows, since they are shell-escaped in Unix fashion.
In order to use the script on Windows, you need to change 'cmdexec' to a more reasonable value. For example, the first and the last example are both usable under Windows. With the last example, you can play a sound with VLC when there's a new post. (But make sure you change the path of VLC and the music file to a valid local path.)
Code:
# No command is the best command :D
cmdexec = ()

# An example of a command on Windows
cmdexec = (r'C:\Program Files\VideoLAN\VLC\vlc.exe C:\skyrocket_explode.mp3', )
Gentoo Linux User (w/ fvwm) / Loyal Firefox User / Owner of a Stupid Old Computer - My PGP Public Key

No man is an island, entire of itself; every man is a piece of the continent, a part of the main; if a clod be washed away by the sea, Europe is the less, as well as if a promontory were, as well as if a manor of thy friends or of thine own were; any man's death diminishes me, because I am involved in mankind; and therefore never send to know for whom the bell tolls; it tolls for thee.
-- Devotions Upon Emergent Occasions (1624), John Donn
Reply


Messages In This Thread
RE: Forum New Posts Notifier for NiftyHost - by RichardGv - 11-16-2010, 10:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How did you find Niftyhost? Serial Thrilla 21 5,561 06-29-2012, 07:26 AM
Last Post: Jennifer
  NiftyHost Server Monitor (created by Piotr GRD) Piotr GRD 21 12,989 01-18-2012, 05:12 AM
Last Post: Serial Thrilla
  OMG COLORS! A Niftyhost Production pspboy 12 4,522 01-18-2012, 05:01 AM
Last Post: Serial Thrilla
  NiftyHost Affiliate System MyDigitalpoint 4 2,050 10-09-2011, 01:12 PM
Last Post: cuckooz
Information How To Run A Board Forum Like myBB And SMF in Your Own PC [just for fun]! KSubedi 31 18,916 08-15-2011, 10:26 AM
Last Post: MyDigitalpoint
  Niftyhost (Forums) reaches 500 registered members Vanilla 36 8,698 06-26-2011, 06:28 AM
Last Post: micro

Forum Jump: