search_apis/search_apis.py
def search_keywords(self, keyword, max_results, se='google'):
        """
        Search relevant pages by keyword using Google

        Args:
        max_results: maximum number of results to return

        """
        urls = []
        if self.keyword_cache.contains(keyword):
            urls = self.keyword_cache.get(keyword)
            print "hit keyword query: ", keyword
        else:
            if se=='google':
                time.sleep(self.google_delay)
                urls = self.google.search(keyword, max_results)
            else:# default: 'bing'
                time.sleep(self.bing_delay)
                urls = self.bing.search(keyword, max_results)
            self.keyword_cache.add(keyword, urls)

        """
        if 'items' in results:
            for item in results['items']:
                urls.append(url_normalize(item['link']))
        """

        print "Keyword Search - Query: ", keyword, " - Number of results: ", len(urls)
        return urls

        Search relevant pages by keyword using Google

        Args:
        max_results: maximum number of results to return

        
Search relevant pages by keyword using Google
Args:
max_results: maximum number of results to return
Search relevant pages by keyword using Google Args : max_results : maximum number of results to return
def search_keywords(self, keyword, max_results, se='google'):
        urls = []
        if self.keyword_cache.contains(keyword):
            urls = self.keyword_cache.get(keyword)
            print "hit keyword query: ", keyword
        else:
            if se=='google':
                time.sleep(self.google_delay)
                urls = self.google.search(keyword, max_results)
            else:
                time.sleep(self.bing_delay)
                urls = self.bing.search(keyword, max_results)
            self.keyword_cache.add(keyword, urls)
        print "Keyword Search - Query: ", keyword, " - Number of results: ", len(urls)
        return urls
def search_keywords ( self , keyword , max_results , se = 'google' ) : urls = [ ] if self . keyword_cache . contains ( keyword ) : urls = self . keyword_cache . get ( keyword ) print "hit keyword query: " , keyword else : if se == 'google' : time . sleep ( self . google_delay ) urls = self . google . search ( keyword , max_results ) else : time . sleep ( self . bing_delay ) urls = self . bing . search ( keyword , max_results ) self . keyword_cache . add ( keyword , urls ) """
        if 'items' in results:
            for item in results['items']:
                urls.append(url_normalize(item['link']))
        """ print "Keyword Search - Query: " , keyword , " - Number of results: " , len ( urls ) return urls
Search relevant pages by keyword using Google
Args:
max_results: maximum number of results to return
Search relevant pages by keyword using Google Args : max_results : maximum number of results to return
"""
        Search relevant pages by keyword using Google

        Args:
        max_results: maximum number of results to return

        """ # default: 'bing' """
        if 'items' in results:
            for item in results['items']:
                urls.append(url_normalize(item['link']))
        """
self
keyword
max_results
se