I wrote a program that takes in a partial rss feed and outputs a full one, but it is one a case by case basis. The recipe for one site is not the same as the recipe for the other. So what I do is look at the domain basename(for instance nyt or wsj) and choose a module based on that. Though I need to load each and every module before hand and have a logical condition for each recipe.
What I need is a way to just have the individual modules in their own respective folder and when I parse out the url basename I want it to look for the module, load it and take some action. So I want the main code base to be independent from the modules. I want to be able to add the modules in the future and never touch the portion of code which interact with them.
Here is a code example
if "nyt" == feed:
nyt.parser(posixpath.basename(url), urldir, rss_file_path, url, feed)
As you can see I call the parser of the individual module. I have many of these based on each website. I want to reed feed and then be able to look for the module, load it and call it, and then if it doesn't exist report it and try the default method.