Hi Peter
today I was asking myself if it's possible to refactor a Downloader so that all specific bits (read CSS selectors) are collected in a very simple subclass.
This would help designing a generic CSS-based downloader, which could be easily-customized to other wallpaper sites just by specifying the CSS selectors required to extract the necessary info from the pages.
So, after half an hour work I got the enclosed WallhavenDownloader example, refactored to remove all CSS selectors from the code in a simpler subclass.
Perhaps the idea could be useful ...
Ciao
AndreaS
PS I haven't yet compared the downoader with the other downloaders (which would allow for further refactorization)
Hi Peter
today I was asking myself if it's possible to refactor a Downloader so that all specific bits (read CSS selectors) are collected in a very simple subclass.
This would help designing a generic CSS-based downloader, which could be easily-customized to other wallpaper sites just by specifying the CSS selectors required to extract the necessary info from the pages.
So, after half an hour work I got the enclosed WallhavenDownloader example, refactored to remove all CSS selectors from the code in a simpler subclass.
Perhaps the idea could be useful ...
Ciao
AndreaS
PS I haven't yet compared the downoader with the other downloaders (which would allow for further refactorization)