mirror of
https://github.com/captn3m0/hackertray.git
synced 2024-09-17 01:40:25 +00:00
20 lines
342 B
Python
20 lines
342 B
Python
import random
|
|
import requests
|
|
|
|
urls = [
|
|
'https://node-hnapi.herokuapp.com/'
|
|
]
|
|
|
|
|
|
class HackerNews:
|
|
|
|
@staticmethod
|
|
def getHomePage():
|
|
random.shuffle(urls)
|
|
for i in urls:
|
|
r = requests.get(i + "news")
|
|
try:
|
|
return r.json()
|
|
except ValueError:
|
|
continue
|