requests.get.text.split

Here are the examples of the python api requests.get.text.split taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

5 Examples 7

Example 1

Project: OmgSite Source File: site_auditor.py
	def bing_information(self, string):
		try:
			return requests.get('http://www.bing.com/search?q=%s%s' % (string, self.site),
						headers=self.headers).text.split('результаты: ')[1].split('</span>')[0].replace('&#160;', '')

		except IndexError:
			return 0

Example 2

Project: bcbio-nextgen Source File: naming.py
def read_mapping(url):
    mappings = {}
    for line in requests.get(url).text.split("\n"):
        parts = line.strip().split()
        if len(parts) == 2:
            first, second = parts
            mappings[str(first)] = str(second)
    return mappings

Example 3

Project: EDeN Source File: __init__.py
Function: read
def read(uri):
    """
    Abstract read function. EDeN can accept a URL, a file path and a python list.
    In all cases an iteratatable object should be returned.
    """
    if hasattr(uri, '__iter__'):
        # test if it is iterable: works for lists and generators, but not for
        # strings
        return uri
    else:
        try:
                    # try if it is a URL and if we can open it
            f = requests.get(uri).text.split('\n')
        except ValueError:
            # assume it is a file object
            f = open(uri)
        return f

Example 4

Project: teleport Source File: gen_hma_hosts.py
def get_hma_config():
    return requests.get(HMA_HOSTS_URL).text.split("\n")

Example 5

Project: pydora Source File: configure.py
Function: fetch_config
    def _fetch_config(self):
        return requests.get(self.KEYS_URL).text.split("\n")