Beispiel #1
0
def _retrieve_wordiq(keyword):
    url = "http://www.wordiq.com/dream/%s"
    url = url % urllib.quote(keyword)
    htmlText = retrieveHttpResponseWithRedirectionHandleException(url)
    if htmlText is None:
        return (RETRIEVE_FAILED, None)
    res, data = dreams.parseDream2(htmlText)
    if res == UNKNOWN_FORMAT:
        logParsingFailure("Get-Dream", keyword, htmlText, url)
    return res, data    
Beispiel #2
0
def _retrieve_dreammoods(keyword):
    url = "http://dreammoods.com/cgibin/searchcsv.pl?search=%s&method=exact&header=symbol"
    url = url % urllib.quote(keyword)
    htmlText = retrieveHttpResponseWithRedirectionHandleException(url)
    if htmlText is None:
        return (RETRIEVE_FAILED, None)
    res, data = dreams.parseDream(htmlText)
    if res == UNKNOWN_FORMAT:
        logParsingFailure("Get-Dream", keyword, htmlText, url)
    return res, data