Ok, I've gotten around that little problem by doing the following:

r = requests.get(
"https://api.datamarket.azure.com/Data.ashx/Bing/SearchWeb/Web?Query=%(term)s&$top=50&$format=json"
 
% __process(), auth=('', API_KEY))

It works for some reason! The problem now is outputting the json data but 
that's another beast entirely. Thanks for your time and help Jonathan


On Thursday, 5 July 2012 16:06:16 UTC+1, Jonathan Lundell wrote:
>
> On 5 Jul 2012, at 8:04 AM, adohertyd wrote:
>
> Oh I see now. Ok tried to implement that still no joy. I'm trying a number 
> of different things still no luck. It's just a matter of perseverance I 
> think!
>
>
> Show your current code, please. 
>
>
> On Thursday, 5 July 2012 15:49:50 UTC+1, Jonathan Lundell wrote:
>>
>> On 5 Jul 2012, at 7:47 AM, adohertyd wrote:
>>
>> No that's not it either Jonathan. The problem I think is with the {'term' 
>> : urllib.quote(term)}. I think that because 'term' is a dict type, the 
>> urllib.quote is having issues with it.
>>
>>
>> That's what I mean. In the case of blekko and entireweb, you're using 
>> (implicitly) term = __process()['term'], but for Bing you're 
>> doing term = __process().
>>
>>
>> On Thursday, 5 July 2012 14:55:06 UTC+1, adohertyd wrote:
>>>
>>> Me again! I don't know why I am getting this error. The process() 
>>> function takes in a value session.term, processes it, and returns it as a 
>>> dict type so that it can be mapped to URL's in the next function. The 
>>> results() function sends the variable 'term' to 3 different API URL's which 
>>> all should return some json results. The entireweb and blekko results come 
>>> back fine if I leave out the bing call; however, the bing results cause the 
>>> error 'Dict object has no attribute rstrip'. The problem has to be in the 
>>> way I'm calling the Bing API. Would really appreciate some guidance here. 
>>> Thanks! This is my default.py controller
>>>
>>
>
>

Reply via email to