Thanks very much. I am now getting the information returned to me.

Do you know if there are any plans to include an article summary in the 
list=geosearch results? That would be terrific. I’ve been using geonames.org 
and it returns a brief 300 character article summary which seems to be the 
first 300 characters of the Wikipedia articles. This is very useful in search 
results, of course. The user can use that information to decide which of the 
several links to click. The title alone is often rather mysterious.

Thanks,
ja
http://vispo.com 

On Sep 9, 2014, at 6:53 AM, Mauricio Déleon <[email protected]> wrote:

> you should use both, the dataType: 'jsonp' on the ajax config and the 
> format=json on the url
> 
> On Tue, Sep 9, 2014 at 6:00 AM, <[email protected]> 
> wrote:
> Send Mediawiki-api mailing list submissions to
>         [email protected]
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
> or, via email, send a message with subject or body 'help' to
>         [email protected]
> 
> You can reach the person managing the list at
>         [email protected]
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Mediawiki-api digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: Cross-domain AJAX problems with Wikipedia's API (jim andrews)
>    2. Re: Cross-domain AJAX problems with Wikipedia's API
>       (Kristian Kankainen)
>    3. Re: Cross-domain AJAX problems with Wikipedia's API (jim andrews)
>    4. Re: Cross-domain AJAX problems with Wikipedia's API (Legoktm)
>    5. Re: Cross-domain AJAX problems with Wikipedia's API (jim andrews)
>    6. Re: Cross-domain AJAX problems with Wikipedia's API
>       (Bartosz Dziewoński)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Mon, 8 Sep 2014 10:34:01 -0700
> From: jim andrews <[email protected]>
> To: [email protected]
> Subject: Re: [Mediawiki-api] Cross-domain AJAX problems with
>         Wikipedia's API
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=windows-1252
> 
> I read the recent thread on cross-domain AJAX problems with Wikipedia’s API 
> but I’m still having problems. I’m getting the following error:
> 
> XMLHttpRequest cannot load 
> https://en.wikipedia.org/w/api.php?action=query&list=recentchanges&format=jsonfm&callback=fooblah&gsradius=10000&gscoord=49.288393%7C-123.113268.
>  No 'Access-Control-Allow-Origin' header is present on the requested 
> resource. Origin 'http://vispo.com' is therefore not allowed access.
> 
> That results after I make the following call:
> $.ajax({url:url, success:ajaxSuccess, error:ajaxError});
> 
> where url is the above url, ajaxSuccess is a function, and so is ajaxError. I 
> also wrote an accessible function fooblah but it doesn’t get called.
> 
> Please advise.
> 
> ja
> http://vispo.com
> 
> 
> -------------------------------------------------------------------------------------------------------------
> Brad wrote:
> 
> There is a whitelist, stored in the configuration variable
> $wgCrossSiteAJAXdomains in CommonSettings.php. This file can be viewed at
> [1], or in revision control at [2].
> 
> You can query anonymously using JSONP (e.g. [3]), or by querying from your
> own server rather than from a webpage. If you are going to be querying from
> a webpage, do review the API Etiquette page.[4]
> 
> 
> 
>  [1]:
> https://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php
> 
>  [2]:
> 
> https://git.wikimedia.org/blob/operations%2Fmediawiki-config.git/master/wmf-config%2FCommonSettings.php
> 
>  [3]:
> 
> https://et.wikipedia.org/w/api.php?action=query&list=recentchanges&format=jsonfm&callback=foobar
> 
>  [4]:
> https://www.mediawiki.org/wiki/API:Etiquette
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Tue, 09 Sep 2014 07:52:44 +0300
> From: Kristian Kankainen <[email protected]>
> To: [email protected]
> Subject: Re: [Mediawiki-api] Cross-domain AJAX problems with
>         Wikipedia's API
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=UTF-8; format=flowed
> 
> Hello!
> 
> I got my queries working with the following code. Try removing your
> callback parameter from the url and try this:
> 
> $.ajax({
>    'url': url,
>    'dataType': 'jsonp',
>    'cache': true,
>    'success': ajaxSuccess,
>    'error': ajaxError
> });
> 
> Kristian K
> 
> 08.09.2014 20:34, jim andrews kirjutas:
> > I read the recent thread on cross-domain AJAX problems with Wikipedia’s API 
> > but I’m still having problems. I’m getting the following error:
> >
> > XMLHttpRequest cannot load 
> > https://en.wikipedia.org/w/api.php?action=query&list=recentchanges&format=jsonfm&callback=fooblah&gsradius=10000&gscoord=49.288393%7C-123.113268.
> >  No 'Access-Control-Allow-Origin' header is present on the requested 
> > resource. Origin 'http://vispo.com' is therefore not allowed access.
> >
> > That results after I make the following call:
> > $.ajax({url:url, success:ajaxSuccess, error:ajaxError});
> >
> > where url is the above url, ajaxSuccess is a function, and so is ajaxError. 
> > I also wrote an accessible function fooblah but it doesn’t get called.
> >
> > Please advise.
> >
> > ja
> > http://vispo.com
> >
> >
> > -------------------------------------------------------------------------------------------------------------
> > Brad wrote:
> >
> > There is a whitelist, stored in the configuration variable
> > $wgCrossSiteAJAXdomains in CommonSettings.php. This file can be viewed at
> > [1], or in revision control at [2].
> >
> > You can query anonymously using JSONP (e.g. [3]), or by querying from your
> > own server rather than from a webpage. If you are going to be querying from
> > a webpage, do review the API Etiquette page.[4]
> >
> >
> >
> >   [1]:
> > https://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php
> >
> >   [2]:
> >
> > https://git.wikimedia.org/blob/operations%2Fmediawiki-config.git/master/wmf-config%2FCommonSettings.php
> >
> >   [3]:
> >
> > https://et.wikipedia.org/w/api.php?action=query&list=recentchanges&format=jsonfm&callback=foobar
> >
> >   [4]:
> > https://www.mediawiki.org/wiki/API:Etiquette
> > _______________________________________________
> > Mediawiki-api mailing list
> > [email protected]
> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
> >
> 
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Tue, 9 Sep 2014 00:10:47 -0700
> From: jim andrews <[email protected]>
> To: MediaWiki API announcements & discussion
>         <[email protected]>
> Subject: Re: [Mediawiki-api] Cross-domain AJAX problems with
>         Wikipedia's API
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=windows-1252
> 
> Hi Kristian,
> 
> Thanks for your help. I have removed the callback parameter (and the 
> format=jsonfm) from the below url and have also changed the $.ajax call as 
> you advise. Consequently, I am no longer getting the error I previously was. 
> However, I am getting the below error:
> 
> Resource interpreted as Script but transferred with MIME type text/html: 
> "https://en.wikipedia.org/w/api.php?action=query&list=recentchanges&gsradius…49.288393%7C-123.113268&callback=jQuery111001502558095380664_1410246334638";.
>  jquery-1.11.0.min.js:4
> Refused to execute script from 
> 'https://en.wikipedia.org/w/api.php?action=query&list=recentchanges&gsradius…49.288393%7C-123.113268&callback=jQuery111001502558095380664_1410246334638'
>  because its MIME type ('text/html') is not executable, and strict MIME type 
> checking is enabled.
> 
> I am getting this error both locally and after I upload to my real server. 
> Please advise.
> 
> ja
> 
> On Sep 8, 2014, at 9:52 PM, Kristian Kankainen <[email protected]> wrote:
> 
> > Hello!
> >
> > I got my queries working with the following code. Try removing your 
> > callback parameter from the url and try this:
> >
> > $.ajax({
> >  'url': url,
> >  'dataType': 'jsonp',
> >  'cache': true,
> >  'success': ajaxSuccess,
> >  'error': ajaxError
> > });
> >
> > Kristian K
> >
> > 08.09.2014 20:34, jim andrews kirjutas:
> >> I read the recent thread on cross-domain AJAX problems with Wikipedia’s 
> >> API but I’m still having problems. I’m getting the following error:
> >>
> >> XMLHttpRequest cannot load 
> >> https://en.wikipedia.org/w/api.php?action=query&list=recentchanges&format=jsonfm&callback=fooblah&gsradius=10000&gscoord=49.288393%7C-123.113268.
> >>  No 'Access-Control-Allow-Origin' header is present on the requested 
> >> resource. Origin 'http://vispo.com' is therefore not allowed access.
> >>
> >> That results after I make the following call:
> >> $.ajax({url:url, success:ajaxSuccess, error:ajaxError});
> >>
> >> where url is the above url, ajaxSuccess is a function, and so is 
> >> ajaxError. I also wrote an accessible function fooblah but it doesn’t get 
> >> called.
> >>
> >> Please advise.
> >>
> >> ja
> >> http://vispo.com
> >>
> >>
> >> -------------------------------------------------------------------------------------------------------------
> >> Brad wrote:
> >>
> >> There is a whitelist, stored in the configuration variable
> >> $wgCrossSiteAJAXdomains in CommonSettings.php. This file can be viewed at
> >> [1], or in revision control at [2].
> >>
> >> You can query anonymously using JSONP (e.g. [3]), or by querying from your
> >> own server rather than from a webpage. If you are going to be querying from
> >> a webpage, do review the API Etiquette page.[4]
> >>
> >>
> >>
> >>  [1]:
> >> https://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php
> >>
> >>  [2]:
> >>
> >> https://git.wikimedia.org/blob/operations%2Fmediawiki-config.git/master/wmf-config%2FCommonSettings.php
> >>
> >>  [3]:
> >>
> >> https://et.wikipedia.org/w/api.php?action=query&list=recentchanges&format=jsonfm&callback=foobar
> >>
> >>  [4]:
> >> https://www.mediawiki.org/wiki/API:Etiquette
> >> _______________________________________________
> >> Mediawiki-api mailing list
> >> [email protected]
> >> https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
> >>
> >
> >
> > _______________________________________________
> > Mediawiki-api mailing list
> > [email protected]
> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
> 
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Tue, 09 Sep 2014 01:14:14 -0700
> From: Legoktm <[email protected]>
> To: [email protected]
> Subject: Re: [Mediawiki-api] Cross-domain AJAX problems with
>         Wikipedia's API
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=UTF-8
> 
> On 9/9/14, 12:10 AM, jim andrews wrote:
> > Hi Kristian,
> >
> > Thanks for your help. I have removed the callback parameter (and the 
> > format=jsonfm) from the below url and have also changed the $.ajax call as 
> > you advise. Consequently, I am no longer getting the error I previously 
> > was. However, I am getting the below error:
> 
> Actually you should pass format=json if you want JSON to be returned. If
> no format parameter is specified, the API defaults to "xmlfm", which is
> an HTML representation of the XML format. See
> <https://www.mediawiki.org/wiki/API:Data_formats#Output> for some more
> details.
> 
> -- Legoktm
> 
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Tue, 9 Sep 2014 01:38:34 -0700
> From: jim andrews <[email protected]>
> To: MediaWiki API announcements & discussion
>         <[email protected]>
> Subject: Re: [Mediawiki-api] Cross-domain AJAX problems with
>         Wikipedia's API
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=windows-1252
> 
> Hi Legoktm,
> 
> Did you note
> 
> $.ajax({
>  'url': url,
>  'dataType': 'jsonp',
>  'cache': true,
>  'success': ajaxSuccess,
>  'error': ajaxError
> });
> 
> I presume the ‘dataType’:’jsonp’ inserts some parameter in the URL that sets 
> the format. To jsonp.
> 
> ja
> 
> On Sep 9, 2014, at 1:14 AM, Legoktm <[email protected]> wrote:
> 
> > On 9/9/14, 12:10 AM, jim andrews wrote:
> >> Hi Kristian,
> >>
> >> Thanks for your help. I have removed the callback parameter (and the 
> >> format=jsonfm) from the below url and have also changed the $.ajax call as 
> >> you advise. Consequently, I am no longer getting the error I previously 
> >> was. However, I am getting the below error:
> >
> > Actually you should pass format=json if you want JSON to be returned. If
> > no format parameter is specified, the API defaults to "xmlfm", which is
> > an HTML representation of the XML format. See
> > <https://www.mediawiki.org/wiki/API:Data_formats#Output> for some more
> > details.
> >
> > -- Legoktm
> >
> > _______________________________________________
> > Mediawiki-api mailing list
> > [email protected]
> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
> 
> 
> 
> 
> ------------------------------
> 
> Message: 6
> Date: Tue, 9 Sep 2014 10:56:20 +0200
> From: Bartosz Dziewoński <[email protected]>
> To: "MediaWiki API announcements & discussion"
>         <[email protected]>
> Subject: Re: [Mediawiki-api] Cross-domain AJAX problems with
>         Wikipedia's API
> Message-ID:
>         <CAA-yUx1k+_0750XL=pa0ebbvctsny6mzwljrfcxg2y4j8sn...@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> It doesn't.
> 
> --
> -- Matma Rex
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> <https://lists.wikimedia.org/pipermail/mediawiki-api/attachments/20140909/9b275878/attachment-0001.html>
> 
> ------------------------------
> 
> _______________________________________________
> Mediawiki-api mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
> 
> 
> End of Mediawiki-api Digest, Vol 87, Issue 8
> ********************************************
> 
> _______________________________________________
> Mediawiki-api mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-api


_______________________________________________
Mediawiki-api mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

Reply via email to