To allow the building of tools that can completely replicate the purpose of the http://www.wikidot.com/new-site page, possibly adding in the IronGiant templates and other tools, it'd be immensely useful if we could create sites using the Wikidot API:
- site.create( String newSiteName )
New site from scratch with a start and admin:manage page only.
- site.create( String newSiteName, String nameOfSiteToClone )
Accepts site name, and clones the non-private pages from site (if cloning is allowed).
Obviously error-checking would have to be added, and an exception thrown if the user has reached their site limit or there is some other reason for it to fail (e.g. attempting to clone a site with more than 100 pages / attempting to clone a private site / cloning blocked).
A more general-purpose solution would be just a new-site method, but allow reading other people's sites if they are clonable. At the moment the API is restricted to sites one administrates. Any site that does not block cloning can be read simply by cloning it, so the API restriction is not a limitation.
The client program can copy pages from the template to the new site. It can also merge templates together, add in snippets and so forth, far more flexibly than the API server could. Although it would need more code on the client side, that might be the best place for it; the Wikidot devs have plenty of work.
My understanding was the the API would use the same methods as is used with the web version - using the existing code for cloning… therefore not much extra work for them to implement cloning into the API. I could be mistaken.
If I understand what you're suggesting — it's identical to my wish request except you feel that the second point in the list ("Method with a String parameter") is unnecessary because it can be done by manually getting a list of pages from the site to be cloned and copying them one-by-one. Is that correct?
The way I see it is that with my proposal there are 1-2 requests from client-server to clone a site. With your suggestion, there are two requests for every single page (get source, create new page) and another request for the original list of pages from the site to be cloned. Therefore for a site with 50 pages:
Less requests = less stress on Wikidot servers, I'd expect?
Cloning would also be a lot quicker if it was done automatically, instead of having to wait for instructions after each page is created.
It all depends on how much effort it would take Wikidot to implement and, in fact, if this is on the TODO list as something they will want to implement. There is a workaround as you pointed out, so the clone method isn't completely necessary — it would just mean a lot less requests between client & server.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I doubt we'll let users create sites (either empty or by cloning) with the API. This could be seriously abused. Imagine an evil application, that you give your key and that kills your site and then creates as many SPAM sites as it can.
By design API operates on existing sites. We want to make API work this way:
Level of access to given site using given API key shows the following table:
Piotr Gabryjeluk
visit my blog
Please discuss API-related topics on developer.wikidot.com forum.