PHP to listen to a site
Hey guys, I want to listen to a site which is not mine, if a post is made on that site it should send me a message and this should be done using PHP. For example, suppose my host is HBH and I want to listen to the forum post so that I can get those post and mail it to my friends. Is there any solution that you would recommend?
You want to email forum posts to your friends? Sounds weird.
I personally recommend that your friends actually comes to forums.
But if really want to do it here's some points which comes up to my mind:
1: Php script looping all the time (or every 5mins or so) 2: Gets data from desired site 3: Saves data somewhere 4: Compare data with existing 5: if something new -> mail link/content/whatever to someone 6: overwrite old data with new
Any helpful or something you knew already?
ZyrgEr wrote: [quote]You want to email forum posts to your friends? Sounds weird. [/quote]
That's just an example, I'm trying to spider a site which contains lot of tools incorporated in it and I want to find new services or data and send an SMS for my subscribers, subscribed to particular content.
1: Php script looping all the time (or every 5mins or so)
There comes the problem, how do I execute my script for long time. When my browser is closed my program's execution stops. I need a solution for this…
Numlock91 wrote: its possible to do in php but then id be more enclined to use python or something similar to read in the webpage if there are any changes to the page than the previous version then split the bit of data you want out.
Can you recommend me how to do it Python. How do I run my Python script on my server for spidering another site while providing service at my site using PHP?
ghostraider100 wrote: [quote]1: Php script looping all the time (or every 5mins or so)
There comes the problem, how do I execute my script for long time. When my browser is closed my program's execution stops. I need a solution for this…[/quote]
Possible with timed operations? If I remember correctly, unix has cron?
ghostraider100 wrote: Can you recommend me how to do it Python. How do I run my Python script on my server for spidering another site while providing service at my site using PHP?
What exactly did you want this to do as far as i understand i just though you needed a tool to read the page and check if its been changed effectively, you could host it online and use http://docs.python.org/2/howto/webservers.html to run it. However id just run a script that looks at the page sees if there is another load of tags which indicate there is a new addition to the forum or just look for changes in the page since the last time you viewed maybe by using Diff or something like that by importing the os. im sure there's a way of doing it purely in python but then you could split that out of the html strip the tags out of it and just leave the text. I'd run it locally and just cron it to be honest.
PM me if you want more info…