linuxgaming

This is my own Linux gaming aggregate web app I built for personal use.
git clone git://git.beardyjay.co.uk/linuxgaming
Log | Files | Refs | README

commit b0114cd861538ddf90738bbb50430832fe0c8067
parent fc2c288974464dfdec1e3f349a9b5b1fabf99b67
Author: Jay Scott <jay@beardyjay.co.uk>
Date:   Thu, 19 Jul 2018 21:38:57 +0100

adding new pages

Diffstat:
MCHANGELOG | 7+++++++
MTODO.md | 2+-
Mconfig/feed_config.yaml | 64+++++++++++++++++++++++++++++++++++++---------------------------
Mlinuxgaming/__init__.py | 4++--
Dlinuxgaming/details.py | 29-----------------------------
Alinuxgaming/sources.py | 38++++++++++++++++++++++++++++++++++++++
Mlinuxgaming/templates/base.html | 14++++++++++----
Mlinuxgaming/templates/macros/items.html | 2+-
Alinuxgaming/templates/pages/all_sources.html | 48++++++++++++++++++++++++++++++++++++++++++++++++
Rlinuxgaming/templates/pages/details.html -> linuxgaming/templates/pages/sources.html | 0
10 files changed, 144 insertions(+), 64 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -3,8 +3,15 @@ Thur 19 Jul -- + - added new pages + - all sources + - gitlab link - refactored +note: had to add an extra website field to the config file to allow me + to pull this info in jinja2. I suspect this can been done out with + this extra info but am not sure how to do it. + Wed 18 Jul --- diff --git a/TODO.md b/TODO.md @@ -1,7 +1,7 @@ # TODO - - add menu with source info / about etc - move updates to AWS Lambda function + - Fix feed_config layout, the websites part. - add API - add Itch.io games - add Steam games diff --git a/config/feed_config.yaml b/config/feed_config.yaml @@ -1,27 +1,7 @@ -linux_gaming: - icon: "reddit.png" - about: "/r/Linux_Gaming is for informative and interesting gaming content and discussions. If you have a question, please check the wiki before posting." - rss: - website: "https://www.reddit.com/r/linux_gaming/" - type: "article" - url: "https://www.reddit.com/r/linux_gaming/new/.rss?limit=300" - -GoG: - icon: "gog.png" - about: "GOG.com is a digital distribution platform with a curated selection of games, a 'you buy it, you own it' philosophy, and utmost care about customers." - gog: - website: "https://www.gog.com/" - -NuSuey: - icon: "nusuey.png" - about: "Linux enthusiast, geek, casual streamer, the guy who made http://tuxdb.com" - twitch: - website: "https://www.twitch.tv/nusuey/" - twitch_id: "7863182" - HexDSL: icon: "hexdsl.png" about: "Linux Gaming Rambles, shows and streams presented by HexDSL. Apparently you don't get a lot of characters in this box. so I'll just say that I am HexDSL (Sexy Hexy) and I make videos about gaming using Linux. I also Host the .XPenguin PodCast/VideoCast that people seem to like :) You can find more of me on twitch.tv/hexdsl/ thanks for taking the time to read this." + website: "https://www.youtube.com/user/hexdsl/" youtube: website: "https://www.youtube.com/user/hexdsl/" channel_id: "UCRE3NFNtdjR96-H4QG4U1Fg" @@ -32,6 +12,7 @@ HexDSL: TheLinuxGamer: icon: "thelinuxgamer.png" about: "Weekly content revolving around Linux gaming. Reviews, tutorials, let's plays, informational videos, and more. I produce reviews of games for Linux through the Humble Store, GOG.com, Steam, PlayDEB and more. You can always find new videos on Tuesdays. Sometimes Fridays, too!" + website: "https://www.youtube.com/user/tuxreviews" youtube: website: "https://www.youtube.com/user/tuxreviews/" channel_id: "UCv1Kcz-CuGM6mxzL3B1_Eiw" @@ -39,6 +20,7 @@ TheLinuxGamer: GamingOnLinux: icon: "gol.png" about: "A little bit of information on who GamingOnLinux are, we are just a small group of passionate Linux fans who wish to bring you nothing but the best in Linux gaming news. Started by liamdawe on his own in 2009 on a .info address, we later switched to using a .com domain name." + website: "https://www.gamingonlinux.com/" rss: website: "https://www.gamingonlinux.com/" type: "article" @@ -50,6 +32,7 @@ GamingOnLinux: BLGP: icon: "blgp.png" about: "The Best Linux Games Podcast features only the best news, reviews, and deals exclusively focusing on titles available for the Linux OS. Heavily focuses on Steam titles. Pushed onto teh interwebs every Saturday and hosted by Skookiesprite, the podcast brings an entire week's worth of news, reviews, tech tips, and the best-loved DEALS! Segment straight into your brain." + website: "http://www.bestlinuxgames.com/" rss: website: "http://www.bestlinuxgames.com/" type: "podcast" @@ -61,23 +44,50 @@ BLGP: LinuxGameConsortium: icon: "lgc.png" about: "Since we maintain the foundation of the Linux community. Yet supporting Linux Gaming through the distrubution of up-to-date content directly from the developers and PR staff. This includes gaming news and information posts, Twitter comments/postings, and/or other social media contact and submissions. Sharing current information and to deter the suggestion that, 'Linux gaming is not widely supported outside of the community'." + website: "https://linuxgameconsortium.com" rss: website: "https://linuxgameconsortium.com" type: "article" url: "https://linuxgameconsortium.com/feed/" +XPenguin: + icon: "xpenguin.png" + about: "A weekly Linux gaming podcast hosted by HexDSL and HamishTPB." + website: "http://xpenguin.club/" + rss: + website: "http://xpenguin.club/" + type: "podcast" + url: "http://xpenguin.club/rss.xml" + MostlyLinux: icon: "mostlylinux.png" about: "Gaming with a touch of Linux and a libertarianish ethos. We are #Freedom #Linux #Privacy #FreeMarkets #Mostly_Gaming." + website: "http://mostlylinux.libsyn.com" rss: website: "http://mostlylinux.libsyn.com" type: "podcast" url: "http://mostlylinux.libsyn.com/rss" -XPenguin: - icon: "xpenguin.png" - about: "A weekly Linux gaming podcast hosted by HexDSL and HamishTPB." +linux_gaming: + icon: "reddit.png" + about: "/r/Linux_Gaming is for informative and interesting gaming content and discussions. If you have a question, please check the wiki before posting." + website: "https://www.reddit.com/r/linux_gaming/" rss: - website: "http://xpenguin.club/" - type: "podcast" - url: "http://xpenguin.club/rss.xml" + website: "https://www.reddit.com/r/linux_gaming/" + type: "article" + url: "https://www.reddit.com/r/linux_gaming/new/.rss?limit=300" + +NuSuey: + icon: "nusuey.png" + about: "Linux enthusiast, geek, casual streamer, the guy who made http://tuxdb.com" + website: "https://www.twitch.tv/nusuey/" + twitch: + website: "https://www.twitch.tv/nusuey/" + twitch_id: "7863182" + +GoG: + icon: "gog.png" + about: "GOG.com is a digital distribution platform with a curated selection of games, a 'you buy it, you own it' philosophy, and utmost care about customers." + website: "https://www.gog.com/" + gog: + website: "https://www.gog.com/" diff --git a/linuxgaming/__init__.py b/linuxgaming/__init__.py @@ -10,7 +10,7 @@ from flask_htmlmin import HTMLMIN import dateutil.parser from . import update -from . import details +from . import sources from . import search from . import database @@ -34,7 +34,7 @@ def create_app(): # register blueprint modules app.register_blueprint(update.BP) - app.register_blueprint(details.BP) + app.register_blueprint(sources.BP) app.register_blueprint(search.BP) @app.route("/") diff --git a/linuxgaming/details.py b/linuxgaming/details.py @@ -1,29 +0,0 @@ -""" -shows more details about the current sources. - -:return: Blueprint -""" -from flask import (Blueprint, flash, redirect, render_template, url_for, - current_app) -from . import database -from . import util - -BP = Blueprint('details', __name__, url_prefix='/details') - - -@BP.route("/<path:path>", methods=["GET"]) -def details(path): - """Source details page""" - feed_config = util.load_yaml() - - if path in feed_config: - source_data = feed_config[path] - else: - flash('1337 Hacks in progress...') - current_app.logger.info('Manual details probe %s', path) - return redirect(url_for('home')) - - source_items = database.find_all({"name": path}) - - return render_template( - 'pages/details.html', data=source_data, entries=source_items) diff --git a/linuxgaming/sources.py b/linuxgaming/sources.py @@ -0,0 +1,38 @@ +""" +shows more sources about the current sources. + +:return: Blueprint +""" +from flask import (Blueprint, flash, redirect, render_template, url_for, + current_app) +from . import database +from . import util + +BP = Blueprint('sources', __name__, url_prefix='/sources') + + +@BP.route("/all", methods=["GET"]) +def sources_all(): + """display all sources""" + + feed_config = util.load_yaml() + + return render_template('pages/all_sources.html', data=feed_config) + + +@BP.route("/<path:path>", methods=["GET"]) +def sources(path): + """Source page""" + feed_config = util.load_yaml() + + if path in feed_config: + source_data = feed_config[path] + else: + flash('1337 Hacks in progress...') + current_app.logger.info('Manual sources probe %s', path) + return redirect(url_for('home')) + + source_items = database.find_all({"name": path}) + + return render_template( + 'pages/sources.html', data=source_data, entries=source_items) diff --git a/linuxgaming/templates/base.html b/linuxgaming/templates/base.html @@ -7,9 +7,9 @@ <title>Linux gaming sources in one place!</title> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> <link rel="icon" href="/favicon.ico" type="image/x-icon"> - <link rel="stylesheet" - href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.3/semantic.min.css" - integrity="sha256-ncjDAd2/rm/vaNTqp7Kk96MfSeHACtbiDU9NWKqNuCI=" + <link rel="stylesheet" + href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.3/semantic.min.css" + integrity="sha256-ncjDAd2/rm/vaNTqp7Kk96MfSeHACtbiDU9NWKqNuCI=" crossorigin="anonymous" /> </head> @@ -39,7 +39,6 @@ <a class="item" href="/search/game" data-content="Filter all games"> <i class="game blue large icon"></i> </a> - <div class="right item"> <div class="item"> <i class="ellipsis vertical disabled icon"></i> @@ -49,6 +48,13 @@ <i class="search olive icon"></i> </div> </div> + <a class="item" href="/sources/all" data-content="Show data sources"> + <i class="database black large icon"></i> + </a> + <a class="item" href="https://gitlab.com/beardyjay/linuxgaming" + data-content="Source code"> + <i class="gitlab orange large icon"></i> + </a> </div> </div> diff --git a/linuxgaming/templates/macros/items.html b/linuxgaming/templates/macros/items.html @@ -27,7 +27,7 @@ </td> <td> {% if not "gog" in item.name %} - <a href="/details/{{ item.name }}"> + <a href="/sources/{{ item.name }}"> <img alt="{{ item.name }} icon" src="{{ url_for('static', filename='images/icons/')}}{{ item.icon }} "> </a> {% else %} diff --git a/linuxgaming/templates/pages/all_sources.html b/linuxgaming/templates/pages/all_sources.html @@ -0,0 +1,48 @@ +{% extends "base.html" %} + +{% block content %} + +{% with messages = get_flashed_messages() %} + {% if messages %} + {% for message in messages %} + <div class="ui massive red icon message"> + <i class="spinner loading icon"></i> + <div class="content"> + <div class="header"> + {{ message }} + </div> + </div> + </div> + {% endfor %} + {% endif %} +{% endwith %} + +<div class="ui three cards"> + + {% for key, value in data.items() %} + <div class="card"> + <div class="blurring dimmable image"> + <div class="ui dimmer"> + <div class="content"> + <div class="center"> + <a href="{{ value.website }}" class="ui inverted button">Visit Them!</a> + </div> + </div> + </div> + <img class="ui small image" src="{{ url_for('static', filename='images/icons/large_')}}{{ value.icon }}"> + </div> + + <div class="content"> + <a class="header">{{ key }}</a> + <div class="meta"> + <span class="date">{{ value.about }} </span> + </div> + </div> + </div> + {% endfor %} + +</div> + +{% endblock %} + + diff --git a/linuxgaming/templates/pages/details.html b/linuxgaming/templates/pages/sources.html