cowsay-blog

commit 0dc4c3cf24b542dd316944205d8505abbab10507

tree

parent:
1743b491bea6b26252966129d93d35921cc0cacd

nick <nick@nick-mykins.local>

2017-03-05T14:04:42-05:00

fix datetime link, about me

diff --git a/cowpost b/cowpost
index ab0aa5b5d9abbe4b7c83bf9803a985d9edb1276f..e0621398044d8d7d1e3161f3fe23a28363e19eba 100755
--- a/cowpost
+++ b/cowpost
@@ -1,10 +1,2 @@
 #!/bin/bash
-
-HERE=$(pwd)
-POSTPATH="$HERE/posts"
-COWPOSTPATH="$HERE/cowposts"
-INFILE="${@: -1}"
-
-(date "+%Y-%m-%d %H:%M:%S" && cowsay "${@:1:($#-1)}" < $INFILE) > "$COWPOSTPATH/$INFILE.cowpost";
-
-mv $INFILE $POSTPATH;
+python cowpost.py $1
diff --git a/cowpost.py b/cowpost.py
index d11b6f43370f07a6d5ca095410551f8336e5c3d8..5c5bcab4703972b4684d54e4cd16de77bda48681 100644
--- a/cowpost.py
+++ b/cowpost.py
@@ -1,6 +1,6 @@
 import sqlite3
 import arrow
-from sh import cowsay
+from sh import cowsay, mv
 import sys
 import os
 PATH = os.getcwd()
@@ -50,7 +50,8 @@ 	filename = sys.argv[1]
 	with open(filename, 'r') as f:
 		text = f.read()
 	db_insert(filename, text)
+	mv(filename, 'posts/')
 
 
 if __name__ == '__main__':
-	main()
\ No newline at end of file
+	main()
diff --git a/cowpostindextemplate.html b/cowpostindextemplate.html
index 505caf111ef0d4d311b1f0c72ac5fa0660e9ba60..c94fb311648a8b578bc534159e1929d020fd9bf3 100644
--- a/cowpostindextemplate.html
+++ b/cowpostindextemplate.html
@@ -9,6 +9,7 @@     <ol>
     {% for cowpost in cowposts %}
     <li> <a href="{{cowpost.htmltitle}}">{{cowpost.htmltitle}}</a>
     {% endfor %}
-    </ol>
+    </ol><br><br>
+  <div><img src="welcome_to_the_internet.gif" alt="welcome_to_the_internet.gif" width="800"></div>
   </body>
 </html>
diff --git a/cowposttemplate.html b/cowposttemplate.html
index dcdc1bf6a96dae767f0e21a28f1d3d70abed4696..45bab683655d0c4ff2d8ac2eaf814c393e5ef0df 100644
--- a/cowposttemplate.html
+++ b/cowposttemplate.html
@@ -1,5 +1,6 @@
 <html>
   <head>
+    <meta charset="UTF-8">
     <title>nick's page</title>
   </head>
   <body>
diff --git a/cowtemplate.html b/cowtemplate.html
index 1c6acaf5a617d553328e355ea08d70332af4f5a2..a7b3ac79086a5885ac817dbbeb4e773d946b3f3f 100644
--- a/cowtemplate.html
+++ b/cowtemplate.html
@@ -1,42 +1,38 @@
-<html>
-  <head>
+
+<!-- saved from url=(0060)file:///Users/nick/Dropbox/code/cowsay-blog/cowtemplate.html -->
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta charset="UTF-8">
     <title>nick's page</title>
   </head>
   <body>
     <link rel="stylesheet" type="text/css" href="style.css">
     <h1>~ nick's page ~</h1>
-    <h2>Optimized for 800x600<br><br>You know when you talk to God as a kid, but then you realize that what you were trying to convince yourself was God responding to your prayers was just more of your own internal monologue? I do.</h2>
+    <h2>Optimized for 800x600<br><br>You know when you talk to God as a kid, but then you realize that what you were trying to convince yourself was God responding to your prayers was just more of your own internal monologue?<br><br></h2>
     <div>
-        <div style="float:left">
-{% for cowpost in cowposts %}<pre>
-<a href="cowposts/{{cowpost.htmltitle}}"><p class=cowdate>{{cowpost.date}}</p></a>{{cowpost.cowtext}}
-</pre>
-{% endfor %}
-        </div>
-        <div style="float:right">
-         <h2> <a href="cowposts">ARCHIVE</a> </h2>
+      <div class="info">
+         <h2> <a href="cowposts">ARCHIVE</a> | <a href="contact.html">CONTACT</a> </h2>
           <br><br>
             About me: <br>
-            <pre>
- ____________________ 
+            <pre> ____________________ 
 / Writer, performer, \
-| hacker: Brooklyn,  |
-\ New York           /
+\ hacker: New York   /
  -------------------- 
         \   ^__^
          \  (##)\_______
             (__)\       )\/\
                 ||----w |
-   <font color=green>\|/</font>          ||     ||
+   <font color="green">\|/</font>          ||     ||
              </pre>
-            <h2>Here's some other stuff:</h2>
-            <ul>
-                <li><a href="http://lt-dan.tumblr.com">Lieutenant Dan</a>
-                <li><a href="http://fart.town:5000">Random Java class name</a>
-                <li><a href="http://github.com/nmyk/cowsay-blog">Cowsay blog on github</a>
-            </ul>
-            <br>
+  <img src="internet_party.gif" alt="internet_party.gif" width="300">
+        </div><div class="posts">
+{% for cowpost in cowposts %}<pre><a href="{{cowpost.htmltitle}}"><p class="cowdate">{{cowpost.date}}</p></a>{{cowpost.cowtext}}
+</pre>
+{% endfor %}
+  <img src="lol_nothing_matters.gif" alt="lol_nothing_matters.gif" width="300">
         </div>
-  </body>
-</html>
+        
+    </div>
+  
+
 
+</body></html>
diff --git a/deploy b/deploy
index 159b3e5effdea2f2c3c77c890291b0297ffdd5f3..9e1dad0c0e677e1639b356f45cb910fe11aff76f 100755
--- a/deploy
+++ b/deploy
@@ -1,5 +1,5 @@
 #!/bin/bash
 
 python deploy.py
-scp public_html/index.html public_html/style.css nick.com:/var/www/cowsay-blog
-scp cowposts_html/*.html nick.com:/var/www/cowsay-blog/cowposts/
+scp public_html/index.html public_html/style.css public_html/contact.html nick.com:/var/www/
+scp cowposts_html/*.html nick.com:/var/www/cowposts/
diff --git a/deploy.py b/deploy.py
index 326db233716b13790544b3e66d48e644f27ccc8b..a2624b3ec732365574e2a5931e1599343d56c1fc 100644
--- a/deploy.py
+++ b/deploy.py
@@ -28,7 +28,7 @@     with db_connect() as conn:
         cur = conn.cursor()
         cur.execute('''
             select date
-                 , title || '.html' as htmltitle
+                 , 'cowposts/' || title || '.html' as htmltitle
                  , cowtext
             from cowposts
             order by id desc''')
diff --git a/public_html/style.css b/public_html/style.css
index ee027fd457fa4aa5dde791ea9f3c21096fbf49f8..2da245a6cb10d2e21e5474ffa68a111e716d032f 100644
--- a/public_html/style.css
+++ b/public_html/style.css
@@ -3,6 +3,7 @@         color: rgb(255,225,148);
         width: 800;
         margin: 0 auto;
         padding: 4em;
+	font-size: 12pt;
         font-family: Ubuntu Mono,
                      DejaVu Sans Mono,
                      Droid Sans Mono,
@@ -12,16 +13,34 @@   .body_narrow {background-color: black;
                 color: rgb(255,225,148);
                 width: 400;
                 margin: 0 auto;
+		font-size: 12pt;
                 font-family: Ubuntu Mono,
                              DejaVu Sans Mono,
                              Droid Sans Mono,
                              Liberation Mono,
                              Monospace;}
+  .info {
+    float:right; 
+  }
+  .posts { 
+    float:left;
+  }
+
+  @media screen and (max-width: 600px) {
+    .info {
+      float:none;
+    }
+    .posts {
+     float:none;
+    }
+  }
+  
   a { color: rgb(0,255,0); }
   a:visited { color: rgb(0,192,0); }
   a:hover { color: white; }
   h1 { font-size: 18pt;
        color: rgb(246,96,171);
        text-align: center; }
+  h2 { font-size: 13pt; }
   p.cowdate { color: rgb(0,255,255); }
-  * { font-size: 12pt }
+  * {cursor: url(cigarette.png), default;}