Menu

#25 Make it possible to set negative priorities using addLinkPriority

open
nobody
None
5
2014-11-17
2014-04-07
MadEgg
No

Currently, it is only possible to increase priorities for links: only positive integers are allowed as argument and the default is 0.

I would like to decrease the priority of certain URLs, for example by setting a negative priority. An alternative solution could be to change the default priority from 0 to something higher.

Discussion

  • Anonymous

    Anonymous - 2014-04-08

    Actually, this is fairly simple. It seems that all of the code is totally capable of working with negative numbers. It's only the initial function addLinkPriority that checks with a regexp if there's it's a positive integer.

    By changing line 1163 in libs/PHPCrawler.class.php to:

    if ($check == true && preg_match("/^\-?[0-9]*$/", $level))
    

    it will also allow negative integers to be entered and it will sort the link queue appropriately.

     
  • Uwe Hunfeld

    Uwe Hunfeld - 2014-11-17

    Hi!

    Thanks for the report and the solution!

    Will change this in the next version (probably).

     

Anonymous
Anonymous

Add attachments
Cancel