Commit c1a5fb3e authored by colmoneill's avatar colmoneill

a refresh of the homepage

parent 22a5e3a3
......@@ -16,7 +16,7 @@ from apscheduler.schedulers.background import BackgroundScheduler
def getGitFeeds():
with app.app_context():
gitlab = feedparser.parse('https://gitlab.com/colmoneill.atom')
gitlab = feedparser.parse('https://gitlab.com/colmoneill.atom?feed_token=bRpn4pzyps8freTKJTxd')
gitconstant = feedparser.parse('https://gitlab.constantvzw.org/colm.atom')
# github = feedparser.parse('https://github.com/colmoneill.atom')
gitlab = gitlab.entries[:10]
......@@ -27,9 +27,16 @@ def getGitFeeds():
commits = sorted(commits, key=itemgetter('updated'), reverse=True)
commits = commits
for entry in commits:
entry.title = entry.title.split(' ', 1)[1]
entry.reponame = entry.title.split()
entry.reponame = entry.reponame[-1]
entry.commit = entry.summary
soup = BeautifulSoup(entry.commit, "html.parser")
soup = soup.find("p", dir="auto")
entry.commit = soup
entry.hreflink = entry.link
entry.link = entry.link.split('/-/')[0]
entry.projectname = entry.link.split('/')[-1]
#entry.title = entry.title.split(' ', 1)[1]
#entry.reponame = entry.title.split()
#entry.reponame = entry.reponame[-1]
entry.updated = datetime.fromtimestamp(mktime(entry.updated_parsed))
def getAdversarialInt():
......@@ -58,11 +65,12 @@ def getOSPFeeds():
def getDraftHighlight():
lastDraft = feedparser.parse('https://gitlab.com/colmoneill/drafts.atom?rss_token=bRpn4pzyps8freTKJTxd')
global lastDraftHash
lastDraftHash = lastDraft.entries[0].id
lastDraftHash = lastDraftHash.split(':')
lastDraftHash = lastDraftHash[-1]
lastDraftHash = ''.join(lastDraftHash)
lastDraftHash = lastDraftHash[-6:]
print(lastDraft)
# lastDraftHash = lastDraft.entries[0].id
# lastDraftHash = lastDraftHash.split(':')
# lastDraftHash = lastDraftHash[-1]
# lastDraftHash = ''.join(lastDraftHash)
# lastDraftHash = lastDraftHash[-6:]
lastDraft = lastDraft.entries[0].link
http = urllib3.PoolManager()
......@@ -82,11 +90,11 @@ def getDraftHighlight():
lastDraftTitle = ' '.join(lastDraftTitle)
print (lastDraft)
getDraftHighlight()
# getDraftHighlight()
getGitFeeds()
getAdversarialInt()
getDraftFeed()
getOSPFeeds()
# getOSPFeeds()
print ("all feed fetch tasks finished")
apsched = BackgroundScheduler()
apsched.start()
......@@ -95,10 +103,12 @@ apsched.add_job(getOSPFeeds, 'interval', minutes=240)
@app.route("/")
def home():
# for date in commits.updated:
# updated = datetime.date(date.updated)
# print (date.updated)
return render_template("home.html", lastDraftLink=lastDraftLink, lastDraftTitle=lastDraftTitle, lastDraftHash=lastDraftHash, draftFeed=draftFeed, commits=commits, adversarialInt=adversarialInt, ospBlog=ospBlog, ospActi=ospActi)
for item in commits:
commit_html = item['summary_detail']['value']
soup = BeautifulSoup(commit_html, "html.parser")
#print(soup.prettify())
commit = soup.div
return render_template("home.html", commits=commits, adversarialInt=adversarialInt)
@app.route("/cv")
def cv():
......
......@@ -194,8 +194,6 @@ div.commit-content blockquote {
}
div.commit-content a.link-to-commit {
font-family: monospace;
color: blue;
text-decoration: underline;
font-size: 1.2em;
}
div.commit-content img.gravatar {
......@@ -314,12 +312,12 @@ h1.title {
padding-top: 30px;
}
.lt-ie9 h1.title {
padding-bottom: 20px;
padding-bottom: 10px;
padding-top: 0px;
}
@media screen and (min-width: 900px) {
h1.title {
padding-bottom: 20px;
padding-bottom: 10px;
padding-top: 0px;
}
}
......
......@@ -112,8 +112,6 @@ div.commit-content{
}
a.link-to-commit{
font-family: monospace;
color: blue;
text-decoration: underline;
font-size: 1.2em;
}
img.gravatar{
......
......@@ -81,12 +81,11 @@ p.align-right{
h1.title{
padding-bottom: 5px;
font-size: 3em !important;
padding-top: 30px;
padding-top: 30px;
@include respond-to($d-vp){
padding-bottom: 20px;
padding-top: 0px;
padding-bottom: 10px;
padding-top: 0px;
}
}
img.full-width-img{
......
......@@ -5,32 +5,18 @@
<div class="row">
<div class="row__colspaced">
<a href="{{lastDraftLink}}">
<div class="colspan12-8 as-grid with-gutter">
<div style="background-color: #{{lastDraftHash}};" class="last-draft">
<h2>{{lastDraftTitle}}</h2>
</div>
{% for entry in draftFeed.entries[:1] %}
<div class="hero-detail">
<p class="hero-detail-text">last update in drafts / {{entry.updated.strftime('%d.%m.%Y @ %H:%M:%S' )}} / with commit message:<em> {{entry.title|safe}} </em></p>
</div>
{% endfor %}
</div>
</a>
<div class="gitgalaxy colspan12-4 as-grid with-gutter">
<h2>git galaxy</h2>
<p>the following lists the very latest ongoing projects, click the 'commit' link to go to the exact, progression or change in the project. Read more on this in the about section.</p>
<div class="gitgalaxy colspan12-8 as-grid with-gutter">
<h1 class="title">latest updates:</h1>
<p>the following list shows the ongoing projects, click the link to go to the exact update or change in the project. Read more on this in the about section.</p>
<div class="feed">
<ul>
{% for entry in commits[0:7] %}
<li>
{{entry.summary|safe}}
on {{entry.reponame}}<br>
<a href="#" class="toggle-visible">toggle details</a>
<b>» {{entry.commit|striptags}}</b>
<br>
<div class="commit-content">
{{entry.title|safe}}
{{entry.updated.strftime('%d.%m.%Y @ %H:%M:%S')}}
<br><a class="link-to-commit" href="{{entry.link}}">go to commit</a>
project: <a href="{{entry.link}}">{{entry.projectname}}</a> | date: {{entry.updated.strftime('%d.%m.%Y @ %H:%M:%S')}}
<br><a class="link-to-commit" href="{{entry.hreflink}}">link to project change or contribution</a>
</div>
</li>
{% endfor %}
......@@ -40,13 +26,11 @@
<ul>
{% for entry in commits[8:20] %}
<li>
{{entry.summary|safe}}
on {{entry.reponame}}<br>
<br><a href="#" class="toggle-visible">details</a>
{{entry.commit|striptags}}
<br>
<div class="commit-content">
{{entry.title|safe}}<br>
{{entry.updated.strftime('%d.%m.%Y @ %H:%M:%S')}}
<br><a class="link-to-commit" href="{{entry.link}}">go to commit</a>
project: <a href="{{entry.link}}">{{entry.projectname}}</a> | date: {{entry.updated.strftime('%d.%m.%Y @ %H:%M:%S')}}
<br><a class="link-to-commit" href="{{entry.hreflink}}">link to project change or contribution</a>
</div>
</li>
{% endfor %}
......@@ -55,20 +39,7 @@
</div>
</div>
</div>
<!-- <div class="row__colspaced"> -->
<!-- <div class="draftFeed colspan12-8 as-grid with-gutter"> -->
<!-- {% for entry in draftFeed.entries %} -->
<!-- <li><a href="#" class="toggle-visible">{{entry.title}} -->
<!-- <div class="commit-content"> -->
<!-- {{entry.summary|safe}} -->
<!-- <a class="link-to-commit" href="{{entry.link}}">go to commit</a> -->
<!-- </div> -->
<!-- </a></li> -->
<!-- {% endfor %} -->
<!-- </div> -->
<!-- </div> -->
</div>
......@@ -125,6 +96,7 @@
</div>
<div class="colspan12-3 colspan8-2 colspan6-2 colspan2-2 as-grid with-gutter">
<h2>OSP's latest project activity</h2>
{#
<div class="feed">
{% for entry in ospActi.entries[:10] %}
<li><a href="#" class="toggle-visible">{{entry.title|safe}} / {{entry.updated.strftime('%d.%m.%Y @ %H:%M:%S')}}
......@@ -136,7 +108,9 @@
{% endfor %}
</div>
<hr>
#}
</div>
{#
<div class="colspan12-6 colspan8-2 colspan6-2 colspan2-2 as-grid with-gutter">
<h2>from the OSP blog</h2>
{% for item in ospBlog.entries[:7] %}
......@@ -147,6 +121,7 @@
</a>
{% endfor %}
</div>
#}
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment