GetNews v0_4: New philosophy
Translation of the original in Catalan. Read it in: CatalàCastellano
After a long time with the GetNews project stopped due to as always time problems. I spent a lot of time thinking about how to solve the problem of the while it takes to load the portal due to the routine of collecting news from other portals...
Well, the matter was not too difficult, I have simply taken the getnews routine made in PHP and divided it into two routines:
getNews.php : it is a PHP Script that is placed in the cron and that connects with the frequency that we want to the sites where we want and collects the news, leaving a backup file in our temporary directory.
viewNews.php : it is a function programmed in PHP as a preprocessor this routine instead of collecting the RDF file of the portal that interests us, what it does is take the backup file that the other routine has collected and make the summary to present on our portal.
So, thanks to these two scripts we will never again have to wait for the site to make the connections to the remote sites so that we can enter the portal.
For now it is in test version, since I have not tested it too much and it does not have too much error support and if until this weekend it works correctly, take the files to download to the pertinent projects directory.
I hope you can enjoy the news service again.
2 comments
Comments from the old blog, as they were written. Comments are closed.
natanael
Ori, m'ha molat el tema aquest del getnews! ja m'explicaràs com ho has
fet!
A reveure
Oriol Rius
Després de gairebé un mes funcionant perfectament el getNews,
degut a un canvi en el RDF d freshmeat he hagut d fer un "patch" en el codi
del modul viewNews.php perquè sinó no reconeixia la lína
de inici i final del contingut del document.
Això és degut a q fins ara tots els RDF en el tag q identificava
el inici i el final no posaven paramentres i ara el d freshmeat n'ha comensat
a posar això m'ha obligat a ser més estricte en les comparacions
i he hagut de modificar dos WHILEs perquè sinó eren
incapaços de detectar les dues parts del document q comento.
A veure si tinc un moment per treure la versió 1 ja q el codi diria q
és molt estable. Però ara me'n vaig a la platja.