On Wed, Aug 29, 2012 at 12:39 AM, Alex Brollo <[email protected]> wrote:
> As you know, wikisource needs robust, well-defined data, and there's a
> strict, deep relationship between wikisource and Commons since Commons
> hosts images of books, in .djvu or .pdf files. Commons shares both images
> and contents fo information page of images, so that any wiki project can
> visualize a view-only "pseudo-page" accessing to a local page named as the
> file name into Commons.
>
> Working into self-made data semantization into it.wikisouce using a lot of
> creative tricks, we discovered that it's hard/almost impossible  to read by
> AJAX calls the contents of pages of other projects since well-known same
> origin policy, but that File: local pages are considered as coming from
> "same origin" so that they can be read as any other local page, and this
> AJAX call asking for the content of
> i.e. File:Die_Judenfrage_in_Deutchland_1936.djvu:
>
> html=$.ajax({url:"
> http://wikisource.org/wiki/File:Die_Judenfrage_in_Deutchland_1936.djvu
> ",async:false}).responseText;
>
>
> gives back the html text of local File: view-only page, and this means that
> any data stored into information page into Commons is freely accessible by
> a javascript script and can easily used locally. In particular, data stored
> into information and/or (much better) Book and Creator templates can be
> retrieved and parsed
>
> Has this been described/used before? It seems a plain, simple way to share
> and disseminate good, consistent metadata into any project; and this runs
> from today, without any change on current wiki software.
>[..]

You can also do this more directly using JSON with callback - Define a
function foo, and put
http://commons.wikimedia.org/w/api.php?action=parse&page=Main_Page&format=json&callback=foo
as the src of the script tag. This works for certain "safe" api
methods. In future we may support CORS which will allow full
cross-origin js requests between Wikimedia sites

However, I think the main issue is that people want to do more things
with metadata  than just retrieving the information with js. I suppose
it all boils down to use-cases. I'll admit I'm not overly familiar
with Wikisource's metadata use case.

--
-bawolff

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to