Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 22nd, 2005, 02:55 AM
Realtime
Guest
 
Posts: n/a
Default Need Guidance On this one


How do I go about writing a php application that will alert people in a database
from different RSS news feeds from different sites. So lets say we have
a database and user A has a list of news alerts he wants to be alerted on.
So the application will go to a search engine that will bring up the results
in XML. The results are then stored in the database. I just need the logic
process. Because I am worried of the latency on the server. So how can
i process multiple alerts per user? Or even process multiple users at once.

Thanks..


  #2  
Old December 22nd, 2005, 10:25 AM
Peter Fox
Guest
 
Posts: n/a
Default Re: Need Guidance On this one

Following on from Realtime's message. . .[color=blue]
>
>How do I go about writing a php application that will alert people in a database
>from different RSS news feeds from different sites. So lets say we have
>a database and user A has a list of news alerts he wants to be alerted on.
>So the application will go to a search engine that will bring up the results
>in XML. The results are then stored in the database. I just need the logic
>process. Because I am worried of the latency on the server. So how can
>i process multiple alerts per user? Or even process multiple users at once.[/color]
Well done for realising you need guidance.

PHP is purely reactive. It bursts into life to process a HTTP request
then dies until the next request. It only sends HTTP responses to
whatever it was that sent the HTTP request.

A grim hack might be meta refresh. A better solution is something other
than PHP.





--
PETER FOX Not the same since the bookshop idea was shelved
peterfox@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
  #3  
Old December 22nd, 2005, 01:15 PM
Realtime
Guest
 
Posts: n/a
Default Re: Need Guidance On this one


Is there any ready made software to accomplish this ?

Hello Peter,
[color=blue]
> Following on from Realtime's message. . .
>[color=green]
>> How do I go about writing a php application that will alert people in
>> a database
>> from different RSS news feeds from different sites. So lets say we
>> have
>> a database and user A has a list of news alerts he wants to be
>> alerted on.
>> So the application will go to a search engine that will bring up the
>> results
>> in XML. The results are then stored in the database. I just need
>> the logic
>> process. Because I am worried of the latency on the server. So how
>> can
>> i process multiple alerts per user? Or even process multiple users at
>> once.[/color]
> Well done for realising you need guidance.
>
> PHP is purely reactive. It bursts into life to process a HTTP request
> then dies until the next request. It only sends HTTP responses to
> whatever it was that sent the HTTP request.
>
> A grim hack might be meta refresh. A better solution is something
> other than PHP.
>[/color]


  #4  
Old December 22nd, 2005, 05:05 PM
NC
Guest
 
Posts: n/a
Default Re: Need Guidance On this one

Realtime wrote:[color=blue]
>
> How do I go about writing a php application that will alert people in a database
> from different RSS news feeds from different sites. So lets say we have
> a database and user A has a list of news alerts he wants to be alerted on.
> So the application will go to a search engine that will bring up the results
> in XML. The results are then stored in the database. I just need the logic
> process. Because I am worried of the latency on the server. So how can
> i process multiple alerts per user? Or even process multiple users at once.[/color]

If you can schedule your script to run every hour or every day using
your operating system's scheduling facility, here's what you can do in
the script itself:

Query the database and obtain a list of all RSS feeds to which users
are sunscribed
For each RSS on the list {
Retrieve the feed
Parse the feed
For each item identified {
Check if it's in the database
If not, write it into the database and send an alert
to all users who subscribe to the feed
}
}

You might want to run this script using the command-line interpreter;
this will save system resources and help you get around the execution
time limit...

Cheers,
NC

  #5  
Old December 23rd, 2005, 01:35 AM
Realtime
Guest
 
Posts: n/a
Default Re: Need Guidance On this one


Thanks

Also is there a application out there that does scheduled database processing
with mySQL.

Hello NC,
[color=blue]
> Realtime wrote:
>[color=green]
>> How do I go about writing a php application that will alert people in
>> a database
>> from different RSS news feeds from different sites. So lets say we
>> have
>> a database and user A has a list of news alerts he wants to be
>> alerted on.
>> So the application will go to a search engine that will bring up the
>> results
>> in XML. The results are then stored in the database. I just need
>> the logic
>> process. Because I am worried of the latency on the server. So how
>> can
>> i process multiple alerts per user? Or even process multiple users at
>> once.[/color]
> If you can schedule your script to run every hour or every day using
> your operating system's scheduling facility, here's what you can do in
> the script itself:
>
> Query the database and obtain a list of all RSS feeds to which users
> are sunscribed
> For each RSS on the list {
> Retrieve the feed
> Parse the feed
> For each item identified {
> Check if it's in the database
> If not, write it into the database and send an alert
> to all users who subscribe to the feed
> }
> }
> You might want to run this script using the command-line interpreter;
> this will save system resources and help you get around the execution
> time limit...
>
> Cheers, NC
>[/color]


  #6  
Old December 23rd, 2005, 06:25 PM
NC
Guest
 
Posts: n/a
Default Re: Need Guidance On this one

Realtime wrote:[color=blue]
>
> Also is there a application out there that does scheduled database
> processing with mySQL.[/color]

To repeat, SCHEDULING IS NOT AN APPLICATION-LEVEL FEATURE, unless you
are willling to write a daemon/process (in which case PHP is probably
not the best tool for the job). Scheduling must be done on the
operating system level. Unix has cron, Windows, AT and Scheduler...

Cheers,
NC

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles