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
4
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(' ', '')
except IndexError:
return 0
3
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
3
Example 3
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
0
Example 4
Project: teleport Source File: gen_hma_hosts.py
def get_hma_config():
return requests.get(HMA_HOSTS_URL).text.split("\n")
0
Example 5
def _fetch_config(self):
return requests.get(self.KEYS_URL).text.split("\n")