Page MenuHomePhabricator
Paste P5925

Check a page on every wikinews
ActivePublic

Authored by Framawiki on Aug 27 2017, 9:27 AM.
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from __future__ import unicode_literals, print_function
import requests
from time import sleep
list = requests.get('https://noc.wikimedia.org/conf/wikinews.dblist').text
for i in list.split('\n'):
lien = 'http://%s.wikinews.org/wiki/Special:NewsFeed' % i[:2]
print('\n' + lien)
req = requests.get(lien)
assert req.status_code == 200
if len(req.text) < 500:
print('bad (%s)' % len(req.text))
else:
print('good (%s)' % len(req.text))
sleep(5)