top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Having a hard time to 'get' bing api search results in python

0 votes
393 views

This is my dilemma, Im trying to get the generated JSON file using the bing api search.

This is the code that Im executing from inside the shell:
http://bin.cakephp.org/view/460660617 [1]

The port doesnt matter to me. Thoughts?

posted Jun 13, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

It looks like the code is mistakenly interpreting 'user:AAAAAAAAA' as a port specifier instead of a username and password. Can you supply the credentials another way, perhaps in a header?

answer Jun 13, 2013 by anonymous
0 votes
> Web?Query=%27xbox%20one%27&

Do you really want to be sending in a %27 ( which is a [ ) vs maybe a %20 ( which is a space ) or even a %29 ( which is a ] )

Cross check your URL encoding is correct.

answer Jun 13, 2013 by anonymous
Similar Questions
+2 votes

I am trying to test measure some IO execution in milliseconds , but bit confuse about best method achive that under windows 7. I am using following code but not sure if its best or correct way since i have two different results, which one should i take as results and which is best way. Please advice

code exec results 
100000000 loops, best of 3: 0.00925 usec per loop
3.827947176762156

run code
 import timeit ,time
 import datetime
 import os

 def main():    
 os.path.getsize("c:/video-2011-09-09-09-32-29.mp4")  
 if __name__ == '__main__':    
 t = timeit.Timer('main()')    
 print (t.timeit(1))
+1 vote

I have about 500 search queries, and about 52000 files in which I have to find all matches for each of the 500 queries.

How should I approach this? Seems like the straightforward way to do it would be to loop through each of the files and go line by line comparing all the terms to the query, but this seems like it would take too long.

Can someone give me a suggestion as to how to minimize the search time?

0 votes

We have few rules (changeable) are stored in a database, and I need to display them for the end user in the form of flow-chart.

Is there such thing for Python?

0 votes

I am running a python script and it will create a file name like filename0.0.0 and If I run it again then new file will create one more like filename0.0.1......
my code is-

i = 0
for i in range(1000):
 try:
 with open('filename%d.%d.%d.json'%(0,0,i,)): pass
 continue
 except IOError:
 dataFile = file('filename%d.%d.%d.json'%(0,0,i,), 'a+')
 break

But It will take more time after creating many files, So i want to store value of last var "i" in a variable so that when I run my script again then I can use it. for example-
my last created file is filename0.0.27 then it should store 27 in a variable and when i run again then new file should be created 0.0.28 according to last value "27", so that i could save time and it can create file fast..

+1 vote

I need to get 32 bit binary equivalent of a decimal and need to change the 0's to 1's and 1's to 0's

For Example
if the input is 2 
Output should be:
the 32bit equivalent of 2 :0000 0000 0000 0000 0000 0000 0000 0010
and the 1's compliment is:1111 1111 1111 1111 1111 1111 1111 1101

is there any pre-defined function to get the above results in python??

...