def init(): global profile_link global s global t global vc global viewcount with open("config.conf", "r") as j: n = json.loads(j.read()) profile_link = hashlib.md5(n["mail"]).hexdigest() profile_link = "http://www.gravatar.com/avatar/%s?s=250" % profile_link s = GitHandler(n["Github"], n["Repo"], n["client_id"], n["client_secret"]) s.fetch_posts() s.fetch_sites() t = time.time() viewcount = {}
import markdown from flask import Markup from lib.git import GitHandler import json import time import hashlib global profile_link with open("config.conf", "r") as j: n = json.loads(j.read()) profile_link = hashlib.md5(n["mail"]).hexdigest() profile_link = "http://www.gravatar.com/avatar/%s?s=250" % profile_link global s global t s = GitHandler(n["Github"], n["Repo"], n["client_id"], n["client_secret"]) s.fetch_posts() s.fetch_sites() t = time.time() def refresh(): global t a = time.time() - t if a > 300: s.fetch_posts() s.fetch_sites() t = time.time() @app.route('/')