Plugin system for sites (Done)
Plugin system for sites (Done)
Is there a way to create one? I'd like to download stories from other sources too, but they ain't in english and to others they would not be interesting. Heck, they'd be useless to most from my country too, so I don't bother asking to add sites for my sake only. And thus, if everyone could create plugins to download fics and whatnot, it'll helps greatly I think.
-
- Posts: 70
- Joined: Wed 23. Mar 2011, 16:19
Re: Plugin system for sites
I second the motion! You could even use something like Imagehostgrabber's host file editor, which allows users to input custom sites using regular expressions. That way, we could stop bugging you every time we wanted a website added.
Or use something similar to mozilla's plugin api to allow users to add their own specific functionality to the base program. Of course, that would probably mean having to shift to a semi open-source model, which I realize that you do not wish to do.
Or use something similar to mozilla's plugin api to allow users to add their own specific functionality to the base program. Of course, that would probably mean having to shift to a semi open-source model, which I realize that you do not wish to do.
Re: Plugin system for sites
Hey,
a Plugin/Script interface is the reason for all of the internal changes during the last two releases.
https://qt-project.org/doc/qt-4.8/qtscript.html
Rai
a Plugin/Script interface is the reason for all of the internal changes during the last two releases.
https://qt-project.org/doc/qt-4.8/qtscript.html
Rai
Read before you report a bug: http://fanfictiondownloader.net/forum/v ... ?f=5&t=175
-
- Posts: 70
- Joined: Wed 23. Mar 2011, 16:19
Re: Plugin system for sites
Qt is certainly a great GUI framework, and makes for easy porting to and from multiple OS platforms. I usually stick to using it or GTK+ when I'm coding for Linux.
Re: Plugin system for sites
Hi,
took much more time than i thought it would be.
http://dl.dropbox.com/u/13474460/script.7z
Write your regular expressions into the script.js file. (I put some examples for ff.net in there)
The script.exe shows the results so you can check if it's working corectly.
So, who's going to write the first script for a new page?
Rai
took much more time than i thought it would be.
http://dl.dropbox.com/u/13474460/script.7z
Write your regular expressions into the script.js file. (I put some examples for ff.net in there)
The script.exe shows the results so you can check if it's working corectly.
So, who's going to write the first script for a new page?
Rai
Read before you report a bug: http://fanfictiondownloader.net/forum/v ... ?f=5&t=175
Re: Plugin system for sites
Hi again,
I've implemented the whole script part into the normal fanfictionDownloader application and wrote an example plugin for fanfiction.net
I'm surprised myself, but it worked without errors.
The Plugin-Creation-Helper is also updated to the latest script-layout file.
The script.js contains the fanfiction.net Example.
Link is still the same: http://dl.dropbox.com/u/13474460/script.7z
So, who's going to write the first plugin for a new website?
Rai
I've implemented the whole script part into the normal fanfictionDownloader application and wrote an example plugin for fanfiction.net
I'm surprised myself, but it worked without errors.
The Plugin-Creation-Helper is also updated to the latest script-layout file.
The script.js contains the fanfiction.net Example.
Link is still the same: http://dl.dropbox.com/u/13474460/script.7z
So, who's going to write the first plugin for a new website?
Rai
Read before you report a bug: http://fanfictiondownloader.net/forum/v ... ?f=5&t=175
Re: Plugin system for sites
I've toyed around with the plugin script a bit doing an implementation for hpfanficarchive.com, it looks like things are working in script.exe. Is it already possible to run use scripts inside calibre?
Here's the link: http://dl.dropbox.com/u/66766320/hpfanf ... script.zip
Here's the link: http://dl.dropbox.com/u/66766320/hpfanf ... script.zip
Re: Plugin system for sites
Hi bitpoet,
well done, it looks like it's working. I'll test it for real this afternoon.
I found one "problem": Your implementation requires the user to enter the link to the index page. It's not working if the chapterlink is entered.
All the other pages within the downloader normaly do it the other way around: they accept the chapterlink but not the index page.
To do it absolute perfect there's this way: (you are allowed to create your own script functions)
In AnalyseContent: Check if the sourcecode is a chapter or the index page. if it's the index page: call a function to analyse everything.
if it's a chapter: create/search the link for the index page and request it by using additonal infos. Then call your analyse function.
This script will never work with calibre, but with the net version of FanFictionDownloader.
(I'll send you a testversion with plugin interface later today)
Rai
well done, it looks like it's working. I'll test it for real this afternoon.
I found one "problem": Your implementation requires the user to enter the link to the index page. It's not working if the chapterlink is entered.
All the other pages within the downloader normaly do it the other way around: they accept the chapterlink but not the index page.
To do it absolute perfect there's this way: (you are allowed to create your own script functions)
In AnalyseContent: Check if the sourcecode is a chapter or the index page. if it's the index page: call a function to analyse everything.
if it's a chapter: create/search the link for the index page and request it by using additonal infos. Then call your analyse function.
This script will never work with calibre, but with the net version of FanFictionDownloader.
(I'll send you a testversion with plugin interface later today)
Rai
Read before you report a bug: http://fanfictiondownloader.net/forum/v ... ?f=5&t=175
Re: Plugin system for sites
Thanks for the feedback Rai, and also for sharing your work. I'll change the script to accept both chapter and story links, shouldn't be that hard.
-Chris
-Chris
Re: Plugin system for sites
And as promised, the version that takes bother story and chapter links: http://dl.dropbox.com/u/66766320/hpfanf ... ipt_v2.zip