A Peek into a Mind

Civax Personal Homepage

Newsgrabber 0.6 - php problems

I’ve almost completed the 0.6 version of cfx-NewsGrabber script. These are the problems I still deal with and the way I’m planning to solve them.

Problem #1: Unified Changeable Form

I wanted to have all the details of the scanned news appear in text boxes and input boxes. This way, instead of approving the news items you’re interested in and then having to go and edit each in the submitted queue, you’d be able to edit all the the items (title, text, topic etc) and send them stright to the Database. Skipping the Submitted News procedure.

However, it turns out I’ll have to create a huge form and have the name of each form element generated real time. This turns out to be a very big mess to do and handle, and a considerable amount of data to send between functions.

I’m currently checking alternatives. If you have any ideas, post them here in the comments.
This feature will not be in the 0.6 release, anyway. I want to do more experiments first to see how can it be done and in what cost.

Problem #2: Importing several profiles with same function inside
This is the only thing waiting to be solved for the new release. The major change I’ve done on 0.6 is the handling of several profiles in one grab, instead of one. Therefore, this problem must be solved first.

The problem is that before parsing a news page the script imports it’s profile. In every profile of version 0.5 there is function reWriteNews. When trying to import another profile while a previous one was already imported, php throws error about the attempt to redefine an already existing function.

After consulting some people on the PHP Developers Network forums, I started looking more deeply into create_function().

Currently I believe I can get it working within a day or two, so expect a new release soon.

The bad side of it is that all 0.5 profiles will have to be changed to fit 0.6. I might write a conversion script, though.

No comments yet. Be the first.

Leave a reply