adding next band, because fun

This commit is contained in:
root 2019-01-08 05:22:27 +00:00
parent 933d39e643
commit 5b3b8edb6a
4 changed files with 155 additions and 3 deletions

49
band_names.py Executable file
View file

@ -0,0 +1,49 @@
#!/usr/bin/env python3
# script by jessebot@linux.com to get the bands and do the things
# 1/7/19 -- 2019? D:
import argparse
import sqlite3
import datetime
import time
def adapt_datetime(ts):
"""
Internet says I need dis
"""
return time.mktime(ts.timetuple())
def main ():
"""
Let's get it on! *cracks whip*
"""
parser = argparse.ArgumentParser(description='Document cool band names.')
parser.add_argument('--band', nargs='?', type=str,
help='a COOL band name')
args = parser.parse_args()
print((args.band))
now = datetime.datetime.now()
sqlite3.register_adapter(datetime.datetime, adapt_datetime)
conn = sqlite3.connect('bands.db')
c = conn.cursor()
# Create table
c.execute('''CREATE TABLE bands
(name text, time text)''')
# Insert a row of data
c.execute("INSERT INTO bands VALUES ({0},{1})".format(args.band,
now))
# Save (commit) the changes
conn.commit()
# We can also close the connection if we are done with it.
# Just be sure any changes have been committed or they will be lost.
conn.close()
if __name__ == "__main__":
main()

View file

@ -39,16 +39,24 @@ def sorted_vars(some_dict):
some_dict[key] = value
return some_dict
# Web routes below this line...
# full path to HTML templates
WEB_ROOT = get_global_variables()['web_root']
bottle.TEMPLATE_PATH.insert(0, '{0}/views/'.format(WEB_ROOT))
@route('/google1ab5c73d1f31729d.html')
def goog():
# allow google to crawl me harder
return static_file('google1ab5c73d1f31729d.html', root=WEB_ROOT+'/views/')
@route('/next-band')
def nextband():
# Grab site specific information - YAML
log.info("oh hi, you must be here to see the name of my next band")
globals = get_global_variables()
return template('next_band', globals=globals)
return template('next-band', globals=globals)
@route('/love')
@ -68,8 +76,48 @@ def hate():
sorted_dislikes = sorted_vars(dislikes)
return template('hate', globals=globals, dislikes=sorted_dislikes)
@route('/resources')
def hate():
# Grab site specific information - YAML
globals = get_global_variables()
dislikes = get_ld_variables("dislikes")
sorted_dislikes = sorted_vars(dislikes)
return template('hate', globals=globals, dislikes=sorted_dislikes)
@route('/nutrition')
def nutrition():
# Grab site specific information - YAML
globals = get_global_variables()
return template('nutrition', globals=globals)
@route('/trans')
def trans():
# Grab site specific information - YAML
globals = get_global_variables()
return template('trans', globals=globals)
@route('/tech')
def tech():
# Grab site specific information - YAML
globals = get_global_variables()
return template('tech', globals=globals)
@route('/resources')
def hate():
# Grab site specific information - YAML
globals = get_global_variables()
dislikes = get_ld_variables("dislikes")
sorted_dislikes = sorted_vars(dislikes)
return template('resources', globals=globals, dislikes=sorted_dislikes)
@route('/dev')
def dev():
# Grab site specific information - YAML
globals = get_global_variables()
return template('dev', globals=globals)

View file

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@ -9,17 +9,29 @@
<meta name="theme-color" content="#1f1f1f" />
<link rel="icon" type="image/x-icon" href="/images/{{globals['favicon']}}">
<meta property="og:url" content="https://jessebot.io">
<meta property="og:image" content="/images/{{globals['image']}}">
<meta property="og:title" content="{{globals['website_title']}}">
<meta property="og:description" content="Resume website for {{globals['name']}}">
<meta property="og:type" content="profile">
<title>{{globals['website_title']}}</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<! -- <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" /> -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<!-- Custom styles for this template -->
<link href="/css/main.css" rel="stylesheet">
<link href="css/tabs.css" rel="stylesheet">
<link href="css/font-style.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 60px;
}
</style>
</head>
<body>

43
views/next-band.tpl Normal file
View file

@ -0,0 +1,43 @@
% include('header_band.tpl')
<div class="container">
<div class="row">
<div class="col-xl-11 col-lg-11 col-md-11 col-sm-11 col-xs-12">
<div class="dash-unit bhoechie-tab-container">
<dtitle>
<span aria-hidden="true" class="li_star fs1"></span>
The Name of My Next Band
</dtitle>
<hr>
<center>
<div class="col-xl-11 col-lg-11 col-md-11 col-sm-11 col-xs-12">
<form>
<center>
<div class="form-group col-md-6">
<label for="inputBand" class="sr-only">Input Band Name Here</label>
<input type="text" class="form-control" id="inputBand" placeholder="Band Name">
<button type="submit" class="btn btn-primary btn-sm mb-2">Submit</button>
</div>
</center>
</form>
</div>
</center>
</div> <!-- /.dash-unit -->
</div> <!-- /.col -->
<div class="col-xl-11 col-lg-11 col-md-11 col-sm-11 col-xs-12">
<div class="dash-unit bhoechie-tab-container">
<dtitle>
<span aria-hidden="true" class="li_star fs1"></span>
About
</dtitle>
<hr>
<div class="aboutText">
This website is dedicated to the name of your next band. Eventually, you'll be able to submit a band name, and it'll generate some cool art for you, but right now, it's under construction.
</div>
</div><!-- /.dash-unit -->
</div><!-- /.col -->
</div><!-- /.row ALL CARDS-->
</div><!-- /.container MAIN-->
% include('footer_main.tpl')