Script to monitor forum


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to monitor forum
# 1  
Old 11-10-2008
Script to monitor forum

Hello. I am attempting to write a pretty complex script that monitors a forum and alerts me whenever a new post is made (this part of the script is done). I then want to have the script auto reply to the post with a predetermined message. The one catch here is this is a VERY popular forum. Within 10 seconds there will already be a reply to this post on the forums. I don't mind if I'm not the first post but when the order of the links change on the forum it makes it harder for me to conceptually script this. The script currently looks like this:

Quote:
while : ; do
while : ; do
if lynx -dump http://www.websiteX |grep "\]0 [0-9]" ; then
echo t
echo | mailx -s "NEW THREAD, go post" yousillygoose@gmail.com & tput bel & beep -l 1500
fi
sleep 2s
date
done
The first command, lynx -dump ...... monitors the forum so that it checks for a 0 followed by a space and then any number. This allows it to search for a reply count of 0 and and view count of 0-9. When it finds this it sends mail to myself, makes a pc tower sound, and makes a speaker sound. If it doesn't find a new post it simply prints the date and sleeps for 2 seconds. My problem is that I now need to have this auto reply a response to the new thread made. The output of the above statement (when a new post is found) looks like:

Quote:
[39] 0 4
with no hyperlink given to follow. The first new thread on the forums is always the 36th link. My problem is that if someone responds to a thread that isn't the newest thread it then moves up to the 36th link (and the thread i want to respond to moves to 37. I need to find a way for my script to both check the forum and reply to the post (if there is a new one) without having to reload the webpage risking the link order to change.

Is this clear? Please help me!

Rob
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Script monitor website wth default tomcat script

Hi all, on our application server we have the following script that monitor the status of the website, my problem here is that i have edite the retries from 3 to 5, and the timewait to 120 second, so the script should check 5 times every 2 minutes, and if the fifth check fails it must restart... (0 Replies)
Discussion started by: charli1
0 Replies

2. Infrastructure Monitoring

Searching for Saas Monitor service which monitor my servers which are sitting in different providers

Sorry if this is the wrong forum Searching for Saas Monitor service which monitor my servers which are sitting in different providers . This monitor tool will take as less CPU as possible , and will send info about the server to main Dashboard. The info I need is CPU / RAM / my servers status (... (1 Reply)
Discussion started by: umen
1 Replies

3. Shell Programming and Scripting

How to monitor a shell script called within a script?

HIi Guys... I am in a fix.... 1st the code : Script 123.sh looks like this : ./abc # a script which is getting called in this script while true do count=`ps -ef | grep abc | wc -l` if echo "abc is running sleep 10 fi done but the process is getting checked... (5 Replies)
Discussion started by: chatwithsaurav
5 Replies

4. UNIX for Dummies Questions & Answers

Monitor a script

Hi All, In a script I would like to check whether the current running command is completed in 1 hour or not. This i want to achieve inside the same script. I don't want to use separate script to monitor my current running script. eg. pseudocode; Command1 if command1>60 mins then... (7 Replies)
Discussion started by: Vicky5
7 Replies

5. Shell Programming and Scripting

Script to monitor Values

Hi All, I want a scrip to monitor values which is the out put of a certain command. Example is $ for (( c=1; c<15; c++ )); do cmu -O HTA -d HTTP-PROXY.tswebpxmp5.$c | grep -i active; done HTA_STATS_htaStatsDef.ifw_stats.streamStat.activeStreams : 2 ... (1 Reply)
Discussion started by: Siddheshk
1 Replies

6. Shell Programming and Scripting

Monitor script

Does anyone have a monitoring script in solaris that monitors the drives in an exclosure? The script should be in /bin/bash or /bin/sh thnks again This should be for solaris 10/11 looking for something that tells me a drive is down or offline.:confused: (0 Replies)
Discussion started by: walnutpony123
0 Replies

7. Shell Programming and Scripting

Help with HD monitor script

Hi, I'm new to linux and I'm trying to compile a hard drive monitoring script. I've seen a few on the internet and I've attempted to stumble through but I'm stuck at my while/do scenario. I assigned the variable NUM then took the percentage from my output and cut the % so it would be just a... (6 Replies)
Discussion started by: crocyson
6 Replies

8. Shell Programming and Scripting

Need help for this monitor log script

this is the format of the log file in my system xxxxx_xxx_xxxx_xxxxx_09_10_2009_170457.log xxxx_xxx_2_0_09_10_2009_163834.log xxx_xxxxxxxxx_25_10_2009_045020.log xxx_xxxxxxx_08_11_2009_055728.log the path of this logs file in on for example /dellxmax/application/log what i want to do... (5 Replies)
Discussion started by: coxmanchester
5 Replies

9. UNIX for Advanced & Expert Users

load monitor script

I need help in finding a script to monitor loads for 8+ servers on a single console. The goal here is to centralize it and run the script from a single server. Can anyone help on this? Im running this script on each server to monitor the load. while true; do w | grep average | grep -v grep... (7 Replies)
Discussion started by: locabuilt
7 Replies
Login or Register to Ask a Question