We love designing and developing websites, but what really drives us is solving problems and cultivating strong relationships with our clients
Yahoo BOSS python api
By : lakshman
Yahoo has a search api with generous limits, BOSS. There are a few python apis around it. But we wanted a lighter api, and one which has the same interface as out Bing Python api. So here is the updated bingapi.(Now with bossapi.py as well). Or svn it from here
Usage
Usage is mostly compatible with bingapi
In [2]: from bingapi import bossapi
In [3]: api = bossapi.Boss('<appid>')
In [4]: api.do_web_search('Uswaretech')
Out[4]: ....
In [5]: api.do_news_search('salsa')
Out[5]: ...
In [6]: api.do_siteexplorer_search('http://uswaretech.com')
Out[6]: .....
Comments
Tom:
http://developer.yahoo.com/search/boss/boss_guide/
It accepts all options described here as keyword arguments.
I think there's a bug in this code.
On line 24, the "query" parameter needs to be quoted. Add "from urllib import quote" somewhere, and then, on line 24, do:
final_url = base_url%(type_, quote(query), payload)
This bug is not normally manifest, because (as far as I can tell) urllib will escape those characters itself. However, if you (as I have) port the code to Google App Engine and use Google's "urlfetch" instead, you may find yourself baffled by this for hours.
;)
Thanks Dan, I was having some problems with the bossapi and I solved thanks to your comment!
I updated the code. So if you checkout from the source, you should not have this problem. Let me if you do.
- How to use pep8.py to write better Django code
- Screencast: Django Tutorial Part 1
- How and why to use pyflakes to write better Python
- Getting started with South for Django DB migrations
- A brief overview of Vagrant
- Writing jQuery plugins using Coffeescript
- Behind the Scenes: Request to Response
- Using SQLite Database with Android
- Haml for Django developers
- Coffeescript for Python programmers
- rails
- django
- linkroundup
- django opinion
- opinion
- business
- API
- appengine
- python
- satire
- startup
- Uncategorized
- marketing
- personal
- rambling
- search
- interviews
- seo-interviews
- 5startupideas
- ideas
- seo
- tips
- forms
- paypal
- utilities
- datetime
- web2.0
- Amazon
- algorithms
- presentations
- products
- pinax
- satchmo
- ecommerce
- microsoft
- yahoo
- book
- tutorial
- models
- aggreagtion
- meta
- India
- apps
- about
- CSS
- Design
- wordpress
- test slug
- vim
- urls
- reviews
- javascript
- xmpp
- emacs
- Typography
- Grid Theory
- Color Theory
- iphone
- android
- titanium
- mobile applications
- CSS3
- Browser Compatibility
- mobile
- jobs
- lamson
- django setup
- files
- upload
- jsTree
- hierarchical view
- web page
- Treeview
- coffeescript
- request
- response
- South
- django south
- django migration
- --fake
- screencasts
- February 2012
- January 2012
- December 2011
- October 2011
- September 2011
- July 2011
- June 2011
- April 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- June 2010
- April 2010
- March 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- April 2009
- March 2009
- February 2009
- November 2008
- October 2008
- June 2008
- May 2008
- April 2008
This is great. Does anybody know how to offset the results in the same way as Bing?