473,320 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

New Message Notification

Hello, I recently came across this great site and discussion board.

I am looking to create a notifier of sorts. I plan on going about this by creating a php script that scans a forum page (for example one of these forums). The php script would be in a constantly open window that refreshes itself every few minutes. The script would be looking for a new post, and if it finds a new post then notify me with a bell sound.

I was thinking of doing this by have two variables that store all of the html on the page into one. When the page refreshes, store the html into the other and check for equivalence. If they are not equivalent, then play the sound, and store the second variable as the first and repeat. If they are equal do nothing.

While I feel that this would work, it seems rather excessive to me. Any thoughts on how I could do this more efficiently?
May 29 '07 #1
5 3146
ak1dnar
1,584 Expert 1GB
Hello, I recently came across this great site and discussion board.

I am looking to create a notifier of sorts. I plan on going about this by creating a php script that scans a forum page (for example one of these forums). The php script would be in a constantly open window that refreshes itself every few minutes. The script would be looking for a new post, and if it finds a new post then notify me with a bell sound.

I was thinking of doing this by have two variables that store all of the html on the page into one. When the page refreshes, store the html into the other and check for equivalence. If they are not equivalent, then play the sound, and store the second variable as the first and repeat. If they are equal do nothing.

While I feel that this would work, it seems rather excessive to me. Any thoughts on how I could do this more efficiently?
Create a Session variable to store the number of posts available for the first time. next time when page refreshed calculate the number of post again and if it is mismatch with the session fire the alert. at the same time destroy the session variable that you created and recreate it for the new number of posts.

I am not sure about the alert sound at this point. but this method might be helpful to go ahead.
May 29 '07 #2
Create a Session variable to store the number of posts available for the first time. next time when page refreshed calculate the number of post again and if it is mismatch with the session fire the alert. at the same time destroy the session variable that you created and recreate it for the new number of posts.

I am not sure about the alert sound at this point. but this method might be helpful to go ahead.
Thank you for the help, I'm not too worried about the alert sound at the moment.
I am having difficulty in figuring out how I would go about counting the number of posts. While I could do it for a specific forum based on the html, I am looking to create a general script that given a forum address regardless of its type (vBulletin, phpBB etc..) it would let me know whether or not a new topic or reply has been created. This is orginally why I had planned on storing all the HTML into a single (now I know to use session variables :) ) session variable and compare it to another.

Do you have any ideas on how I could go about counting posts regardless of the forum type? Thanks again.
May 30 '07 #3
ak1dnar
1,584 Expert 1GB
Do you have any ideas on how I could go about counting posts regardless of the forum type?
You can use mysql_num_rows to count the number of posts available and store it in the session.
May 30 '07 #4
You can use mysql_num_rows to count the number of posts available and store it in the session.
Ah I see, I am assuming that I do not have access to the database for the forum. This is a project to have notifications for all the forums that I frequent. For example, this forum, I do not have access to the database but I would like to know when a new post has arrived.
May 30 '07 #5
ak1dnar
1,584 Expert 1GB
Are you planing to display your posts in a web page with out using a flat file or database as the back end.

end users will add posts to the forum right?
Then where you going to store these records? on the web page <body>.
May 30 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Hai Ly Hoang [MT00KSTN] | last post by:
Different between Notification & Message is a bit hazy for me. Anyone can explain in detail for me ? Thanks in advance !
3
by: Robert W. | last post by:
I have a separate thread that handles data transfer operations (with a mobile device). I've set things up so that a small notification form is displayed in the lower right corner of the window. ...
3
by: Kenny M. | last post by:
Hi I have like 10 clients running around the city conected via internet to a SQL DB, when I start the win application I sent the IPaddress of each machine and store then into the DB. I have a...
1
by: barbara_dave | last post by:
Hi all, I want do Event/Notification when a USB device plugged in. I am working on a Windows 2000 computer. Is there a way to do that? Thanks a lot!
3
by: gv | last post by:
Hello, I just want to parse out the string notification of the message not the rest that m.tostring returns? Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) ...
6
by: Rudy | last post by:
Hello all! I'm working in vb/ado.net I want to to have a message box pop up based on a result of a update on a SQL table. How do I do that so it automaticly pops up after the update is...
3
by: Sam Durai | last post by:
Is there any method available in DB2 V8 to retrieve only the Warning or Severity messages from the notification log ? PS: I'm looking for something similar to PD_GET_DIAG_HIST function available...
1
by: brunovg | last post by:
Hello, There's any way to configure a CDO.Message object to set the read and delivery receipt option, in C#? I already tried: CDO.Message msg = new CDO.Message(); .... msg.Fields.Value =
0
by: vsrprasad16 | last post by:
Hi All, I am implementing a notification form similar to outlook email notification. my application call this notification form from a dll. this dll includes a form class and this dll has some...
4
markmcgookin
by: markmcgookin | last post by:
Has anyone used the notification class from Windows CE forms? using the following code using Microsoft.WindowsCE.Forms; ... Notification note = new Notification()
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.