ℹ️ HackerTray is a minimalist Hacker News app for Linux
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hackertray/hackertray/hackernews.py

19 lines
342 B

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