import requests
import hashlib
from datetime import datetime


def get_feed_hash(url):
    """ Returns hash of a feed and timestamp """
    fetched = requests.get(url)
    m= hashlib.sha256()
    m.update(fetched.text.encode())
    text_hash = m.hexdigest()
    ts = int(datetime.utcnow().timestamp())
    return text_hash, ts