View Single Post
Old 10-04-2018, 09:04 PM   #2958
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,015
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Kern View Post
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.
JimmXinu is online now   Reply With Quote