Hi Everybody,

I was trying to access Digg's search API with $.getJSON as well as
with Twitter and Identica.

Although, the twitter and identica search api are working fine, I have
found trouble when it come to accessing Digg API.

The case in point URL :
http://services.digg.com/search/stories?query=geeko&appkey=http%3A%2F%2Filovejquery.org&type=javascript&count=15&callback=someFunction

This URL, when provided in location bar of the browser gives back the
result successfully. Now change the "someFunction" with "?"  to access
( for JSONP approach in $.getJSON ) the JSON data provided by this
Digg API URL in a jQuery code and sadly it will give return error
message  saying "Unrecognized argument".

The script element generated is following.
-------
<script src="http://services.digg.com/search/stories?
query=geeko&appkey=http%3A%2F
%2Filovejquery.org&type=javascript&count=15&callback=jsonp1248445717722&_=1248445717771">
------

This is due to the additional argument provided when replacing "?" in
the implementation of getJSON method . That additional argument has
"_" as name and some timestamp  as value.

I commented out line 3453 in the latest jquery-1.3.2.js file meant to
be used while in development and things are working fine. Note that, I
don't see any change of behaviour for the Twitter as well as Identica
call. It looks they are ignoring the additional arguments while the
Digg is not.

I don't know why the additional parameter is added while replacing "?"
in getJSON request, but it is definately not acceptable to one of the
popular webservice.

Hope this brings any compatibility issue to the notice.

Thanks & Best Regards

Samyak

Reply via email to