Quote:
Originally Posted by Kern
Is there documentation for that? I have a vague idea what to do looking at the source.
|
There isn't a document as such. I should probably make one some day.
The key steps of creating an adapter are:
- Create the fanficfare/adapters/adapter_<site>.py file, probably by copying an existing one
- Add an import to fanficfare/adapters/__init__.py for the new file
- Change the class name and siteabbrev value
- Change the code to normalize story URLs
- Change site example urls
- Change the regex code to recognize story URLs
- Change the code to fetch, parse and save metadata (extractChapterUrlsAndMetadata)
- Change the code to login to the site, if needed
- Change the code to fetch and parse each chapter text (getChapterText)
- Add entries for the site to plugin-defaults.ini & defaults.ini if the adapter has settings.
Differences in sites makes it hard to choose which adapter to start from, but
this adapter has some comments about making a new one.
The code is in
GitHub. You can fork your own copy of the repos, work there and then create a Pull Request I can merge in.