kba / rssscrpr

Scrape web content to RSS feeds
https://rssscrpr.herokuapp.com/
MIT License
1 stars 2 forks source link

Costumization (in scraper) is always checked #4

Open zuphilip opened 9 years ago

zuphilip commented 9 years ago

Steps to reproduce:

  1. Choose "InetBib" Example
  2. Activate "Customize" in scraper section
  3. Enter \\h1 in "Item Xpath"
  4. Deactivate "Customize" again
  5. Run.

This will incorrectly run the scraper with the customization and therefore only return 1 result. The deactivitating step seem to miss something. I didn't check if the same is true for the other sections.

kba commented 9 years ago

These checkboxes only toggle folding of sub-forms right now. It would be wise to find a more generic soliution how to lay out components and options using reflection of the PHP classes and then properly wiring them. For now, I hesitate to hard-code add any component-specific logic to JS logic.

zuphilip commented 9 years ago

If I understand correctly, then the click on "Go!" is calling some JavaScript. Can we filter out the values of the scraper customizations if the corresponding checkbox is not activated? I.e. at https://github.com/kba/rssscrpr/blob/master/main.js#L54

$("form :input").filter(function(index, element) {
    /*
      TODO: only return costumization fields 
      if the corrsponding checkbox is activated
    */
    return $(element).val() != "";
}).serialize();

What do you think?

zuphilip commented 9 years ago

I guess now that the Edit function has to activate some checkboxes, if some the parameters are entered. For example "Rektoratsnachrichten" is not working currently.

kba commented 9 years ago

True. But these are just examples and should be tweaked anyway. I'd prefer to fix this by populating the user interface properly from API data.