Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Flask
feedgen
markupsafe
markupsafe
requests
18 changes: 13 additions & 5 deletions server
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import os
import subprocess
import sys
from datetime import datetime
import requests

# Library to implement rss
from feedgen.feed import FeedGenerator
Expand All @@ -15,17 +16,24 @@ from markupsafe import Markup
app = Flask(__name__)
app.jinja_env.globals['include_raw'] = lambda filename: Markup(app.jinja_loader.get_source(app.jinja_env, filename)[0])
CONFIG_FILE = 'content.json'
TEAM_FILE = 'team.json'
TEAM_FILE = 'https://zippy-app.monadical.io/api/team-page/?format=json'
STACK_FILE = 'stacks.json'
OPEN_POSITIONS = 'open-positions.json'
PORTFOLIO = 'portfolio.json'
HOST = 'http://127.0.0.1:5000'


def load_config(fname=CONFIG_FILE):
"""read the content.json file and load it as a dictionary"""
with open(fname, 'r') as f:
return json.load(f)
def is_url(inp: str) -> bool:
"""check if a string is a url"""
return inp.startswith('http://') or inp.startswith('https://')

def load_config(source: str = CONFIG_FILE):
"""find the source ( either a url or a file path ) and load it as a dictionary"""
if is_url(source):
return requests.get(source).json()
else:
with open(source, 'r') as f:
return json.load(f)


def download_post(post):
Expand Down