Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import requests
- class CheckUrl(object):
- OLD_API_URLS = ['http://api.news.rambler.ru/newapi/fast/rambler/head/',
- 'http://api.news.rambler.ru/newapi/fast/rambler/ukraine/',
- 'http://api.news.rambler.ru/newapi/fast/rambler/moscow_city/',
- 'http://api.news.rambler.ru/newapi/fast/rambler/politics/',
- 'http://api.news.rambler.ru/newapi/fast/rambler/sport/',
- 'http://api.news.rambler.ru/newapi/fast/rambler/incidents/',
- 'http://api.news.rambler.ru/newapi/fast/rambler/auto/',
- 'http://api.news.rambler.ru/newapi/fast/rambler/scitech/',
- 'http://api.news.rambler.ru/newapi/fast/rambler/games/',
- 'http://api.news.rambler.ru/newapi/fast/rambler/business/',
- 'http://api.news.rambler.ru/newapi/fast/rambler/lifestyle/',
- 'http://api.news.rambler.ru/newapi/fast/rambler/health/',
- 'http://api.news.rambler.ru/newapi/fast/rambler/starlife/']
- NEW_API_URLS = ['http://coolstream.rambler.ru/top/clusters/comments']
- def check_url(self):
- urls = self.OLD_API_URLS + self.NEW_API_URLS
- for url in urls:
- r = requests.get(url, timeout=30)
- sc = r.status_code
- assert sc == 200, 'Url: {} return status code: {}'.format(url, sc)
- if __name__ == '__main__':
- c = CheckUrl()
- c.check_url()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement