Browse Source

now tweaks

windhamdavid 1 year ago
parent
commit
e5b0c7f938
6 changed files with 126 additions and 147 deletions
  1. 1 1
      functions.php
  2. 1 0
      header.php
  3. 113 78
      inc/utils.php
  4. 2 64
      page-now.php
  5. 9 4
      style.css
  6. 0 0
      v4-style.min.css

+ 1 - 1
functions.php

@@ -100,7 +100,7 @@ function dw_scripts() {
 		wp_enqueue_script( 'form', get_template_directory_uri() . '/js/contact.js', '', '', true );
 	}
 
-	elseif ( is_page('pay') ) {
+  elseif ( is_page('pay') ) {
 		require( get_template_directory() . '/inc/form.php' );
 		//gravity_form_enqueue_scripts(1, false);
     wp_enqueue_script( 'scriptmin', get_template_directory_uri() . '/js/v4-script.min.js', '', '', true );

+ 1 - 0
header.php

@@ -11,6 +11,7 @@
 <meta http-equiv="X-UA-Compatible" content="IE=edge" />
 <meta name="description" content="<?php dw_meta_desc();?>"/>
 <?php wp_head(); ?>
+<?php if ( is_singular() ) echo '<link rel="canonical" href="' . get_permalink() . '" />'; ?>
 </head>
 <body <?php page_bodyclass(); ?>>
 <header id="header">

+ 113 - 78
inc/utils.php

@@ -79,7 +79,6 @@ function _s_backbone_get_request_parameters() {
 
 function til() {
 	require_once('lib/html_dom.php');
-
 	$url = 'https://davidawindham.com/til/index.html';
 	$html = file_get_html($url);
 	$i = 0;
@@ -90,7 +89,6 @@ function til() {
 }
 function pull_til() {
 	require_once('lib/html_dom.php');
-
 	$url = 'https://davidawindham.com/til/index.html';
 	$html = file_get_html($url);
 	$i = 0;
@@ -101,7 +99,6 @@ function pull_til() {
 }
 function pull_til_all() {
 	require_once('lib/html_dom.php');
-
 	$url = 'https://davidawindham.com/til/index.html';
 	$html = file_get_html($url);
 	$i = 0;
@@ -111,7 +108,6 @@ function pull_til_all() {
 }
 function bookmarks() {
 	require_once('lib/html_dom.php');
-
 	$url = 'https://davidawindham.com/bookmarks/';
 	$html = file_get_html($url);
 	$i = 0;
@@ -124,7 +120,6 @@ function bookmarks() {
 }
 function bookmarks_pull() {
 	require_once('lib/html_dom.php');
-
 	$url = 'https://davidawindham.com/bookmarks/';
 	$html = file_get_html($url);
 	$i = 0;
@@ -137,7 +132,6 @@ function bookmarks_pull() {
 }
 function bookmarks_all() {
 	require_once('lib/html_dom.php');
-
 	$url = 'https://davidawindham.com/bookmarks/';
 	$html = file_get_html($url);
 	$i = 0;
@@ -147,22 +141,9 @@ function bookmarks_all() {
 		}
 	}
 }
-function photo() {
-	require_once('lib/html_dom.php');
 
-	$url = 'https://photo.davidwindham.com/#16734437965516';
-	$html = file_get_html($url);
-	$i = 0;
-	foreach ($html->find('.photo .overlay h1') as $li) {
-    if (!empty($html)) {
-      echo str_replace('href="/', 'href="https://photo.davidawindham.com/', $li . '&nbsp;');
-      if (++$i == 18) break;
-    }
-  }
-}
 function work() {
 	require_once('lib/html_dom.php');
-
 	$url = 'https://davidawindham.com/til/notes/work';
 	$html = file_get_html($url);
 	$i = 0;
@@ -199,160 +180,214 @@ function todone() {
     }
   }
 }
-function code() {
-	require_once('lib/html_dom.php');
 
-	$url = 'https://code.davidawindham.com/david';
-	$html = file_get_html($url);
-	$i = 0;
-	foreach ($html->find('.item a.name, p.has-emoji, span.time-since') as $li) {
-    if (!empty($html)) {
-      //$time = find('.time-since') as $time;
-      echo str_replace('href="/', 'href="https://code.davidawindham.com/', $li . '&nbsp;');
-      //echo $time . '&nbsp;';
-      if (++$i == 9) break;
-    }
-  }
-}
 function docs() {
 	require_once('lib/html_dom.php');
-
 	$url = 'https://davidawindham.com/til/docs';
 	$html = file_get_html($url);
 	$i = 0;
 	foreach ($html->find('.markdown ul li') as $li) {
 	    if (!empty($html)) {
 			echo $li;
-      if (++$i == 7) break;
+      if (++$i == 5) break;
 		}
 	}
 }
-function docs_code() {
+function lists() {
 	require_once('lib/html_dom.php');
-
-	$url = 'https://code.davidawindham.com/david/til/src/main/docs';
+	$url = 'https://davidawindham.com/til/lists/';
 	$html = file_get_html($url);
 	$i = 0;
-	foreach ($html->find('table tr td') as $li) {
+	foreach ($html->find('.markdown ul li') as $li) {
 	    if (!empty($html)) {
-      //if($i++ == 1) continue;
-      echo str_replace('href="/', 'href="https://code.davidawindham.com/', $li);
-      if(!($i++ % 3)) {
-        echo '<br>';
-      }
-      if (++$i == 1) break;
+			echo $li;
+      if (++$i == 5) break;
 		}
 	}
 }
-function lists() {
+function notes() {
 	require_once('lib/html_dom.php');
 
-	$url = 'https://davidawindham.com/til/lists/';
+	$url = 'https://davidawindham.com/til/notes/';
 	$html = file_get_html($url);
 	$i = 0;
 	foreach ($html->find('.markdown ul li') as $li) {
 	    if (!empty($html)) {
 			echo $li;
-      if (++$i == 7) break;
+      if (++$i == 5) break;
 		}
 	}
 }
-function lists_code() {
+
+function playing() {
 	require_once('lib/html_dom.php');
 
-	$url = 'https://code.davidawindham.com/david/til/src/main/lists';
+	$url = 'https://davidawindham.com/til/lists/now/playing';
 	$html = file_get_html($url);
 	$i = 0;
-	foreach ($html->find('table tr td') as $li) {
+	foreach ($html->find('.markdown ul li') as $li) {
 	    if (!empty($html)) {
-      //if($i++ == 1) continue;
-      if (++$i == 2) break;
-      echo str_replace('href="/', 'href="https://code.davidawindham.com/', $li);
-      if(!($i++ % 3)) {
-        echo '<br>';
-      }
-
+			echo $li;
+      if (++$i == 3) break;
 		}
-
 	}
 }
-function notes() {
+function watching() {
 	require_once('lib/html_dom.php');
 
-	$url = 'https://davidawindham.com/til/notes/';
+	$url = 'https://davidawindham.com/til/lists/now/watching';
 	$html = file_get_html($url);
 	$i = 0;
 	foreach ($html->find('.markdown ul li') as $li) {
 	    if (!empty($html)) {
 			echo $li;
-      if (++$i == 7) break;
+      if (++$i == 3) break;
 		}
 	}
 }
 function listening() {
 	require_once('lib/html_dom.php');
-
 	$url = 'https://davidawindham.com/studio/music/';
 	$html = file_get_html($url);
 	$i = 0;
 	foreach ($html->find('ul .wtracks li') as $li) {
 	    if (!empty($html)) {
 			echo $li;
-      if (++$i == 7) break;
+      if (++$i == 3) break;
 		}
 	}
 }
 function reading() {
 	require_once('lib/html_dom.php');
-
 	$url = 'https://davidawindham.com/til/lists/now/reading';
 	$html = file_get_html($url);
 	$i = 0;
 	foreach ($html->find('.markdown ul li') as $li) {
 	    if (!empty($html)) {
 			echo $li;
-      if (++$i == 7) break;
+      if (++$i == 3) break;
 		}
 	}
 }
 function learning() {
 	require_once('lib/html_dom.php');
-
 	$url = 'https://davidawindham.com/til/lists/now/learning';
 	$html = file_get_html($url);
 	$i = 0;
 	foreach ($html->find('.markdown ul li') as $li) {
 	    if (!empty($html)) {
 			echo $li;
-      if (++$i == 7) break;
+      if (++$i == 3) break;
 		}
 	}
 }
-function playing() {
+
+/********************************/
+/************  Code  ************/
+/********************************/
+
+function code() {
 	require_once('lib/html_dom.php');
 
-	$url = 'https://davidawindham.com/til/lists/now/playing';
+	$url = 'https://code.davidawindham.com/david?tab=activity';
 	$html = file_get_html($url);
 	$i = 0;
-	foreach ($html->find('.markdown ul li') as $li) {
+	foreach ($html->find('.content ul li') as $li) {
+    foreach ($li->find('span.text') as $comment) {
+
+      if (!empty($html)) {
+        $str = array('href="/', 'light');
+        $replace = array('href="https://code.davidawindham.com/', '');
+        //echo str_replace($str,$replace, $li . ' - ' . $commit . ' - ' . $comment . '<br>');
+        echo str_replace($str,$replace, $li . '' . $comment . '<br>');
+      }
+    }
+    //foreach ($html->find('span.text') as $comment) {}
+    if (++$i == 5) break;
+
+  }
+}
+function commits() {
+	require_once('lib/html_dom.php');
+
+	$url = 'https://code.davidawindham.com/david?tab=activity';
+	$html = file_get_html($url);
+	$i = 0;
+	foreach ($html->find('ul li a') as $li) {
+    if (!empty($html)) {
+      $str = array('href="/', 'light');
+      $replace = array('href="https://code.davidawindham.com/', '');
+      echo str_replace($str,$replace, date("y/m/d") . ' - ' . $li . '<br>');
+      if (++$i == 3) break;
+    }
+  }
+}
+function docs_code() {
+	require_once('lib/html_dom.php');
+
+	$url = 'https://code.davidawindham.com/david/til/src/main/docs';
+	$html = file_get_html($url);
+	$i = 0;
+	foreach ($html->find('table tr td') as $li) {
 	    if (!empty($html)) {
-			echo $li;
-      if (++$i == 7) break;
+      //if($i++ == 1) continue;
+      echo str_replace('href="/', 'href="https://code.davidawindham.com/', $li);
+      if(!($i++ % 3)) {
+        echo '<br>';
+      }
+      if (++$i == 1) break;
 		}
 	}
 }
-function watching() {
+
+function lists_code() {
 	require_once('lib/html_dom.php');
 
-	$url = 'https://davidawindham.com/til/lists/now/watching';
+	$url = 'https://code.davidawindham.com/david/til/src/main/lists';
 	$html = file_get_html($url);
 	$i = 0;
-	foreach ($html->find('.markdown ul li') as $li) {
+	foreach ($html->find('table tr td') as $li) {
 	    if (!empty($html)) {
-			echo $li;
-      if (++$i == 7) break;
+      //if($i++ == 1) continue;
+      if (++$i == 2) break;
+      echo str_replace('href="/', 'href="https://code.davidawindham.com/', $li);
+      if(!($i++ % 3)) {
+        echo '<br>';
+      }
+
 		}
+
 	}
 }
 
+function photo() {
+	require_once('lib/html_dom.php');
+
+	$url = 'https://photo.davidwindham.com/#16734437965516';
+	$html = file_get_html($url);
+	$i = 0;
+	foreach ($html->find('.photo .overlay h1') as $li) {
+    if (!empty($html)) {
+      echo str_replace('href="/', 'href="https://photo.davidawindham.com/', $li . '&nbsp;');
+      if (++$i == 18) break;
+    }
+  }
+}
+
+
+//function mastodon() {
+//	require_once('lib/html_dom.php');
+//
+//	$url = 'https://universeodon.com/@windhamdavid/with_replies';
+//	$html = file_get_html($url);
+//	$i = 0;
+//	foreach ($html->find('.status__content__text p') as $li) {
+//    if (!empty($html)) {
+//      echo str_replace('href="/', 'href="https://universeodon.com/', $li . '&nbsp;');
+//      if (++$i == 18) break;
+//    }
+//  }
+//}
+
+
 

+ 2 - 64
page-now.php

@@ -16,7 +16,7 @@ get_header(); ?>
 				<div class="row mt-3">
           <div class="col-lg-7">
             <p class="fs-5 mb-3 lh-base"><span class="mt-1 firstcharacter">A</span> <b><em>NOW</em></b> page... some idea I ran across at some point which made sense. It's basically what I've been doing pulled in from various files. I've developed a habit of keeping notes while working. It started with my work notes and has expanded to items like my grocery lists because they fit right into the same workflow. I just sync a set of files to a server and viola, it's here.</p>
-            <p><b>23/07/17</b> - I made this page because it was too 🔥 outside last weekend. I also wanted to simplify my navigation and make my markdown files first class citizens on this website because I update them more often.</p>
+            <p><b>23/07/17</b> - I made this page because it was 🔥 outside last weekend that I found myself in front of the computer looking at my own website. I also wanted to simplify the navigation to make my markdown files first class citizens on this website because I update them more often.</p>
           </div>
           <div class="col-lg-4 offset-md-1">
 						<h5 class="fw-bold mt-2">Posts</h5>
@@ -49,7 +49,7 @@ get_header(); ?>
 						</ul>
 					</div>
         </div>
-        <div class="row mt-3">
+        <div class="row mt-3 mb-5 pb-2">
           <div class="col-lg-4">
             <h5 class="fw-bold mt-2">Docs</h5>
             <ul style="margin:0">
@@ -66,68 +66,6 @@ get_header(); ?>
             <h5 class="fw-bold mt-2">Notes</h5>
             <ul style="margin:0">
             <?php notes(); ?>
-						</ul>
-					</div>
-				</div>
-        <div class="row mt-3">
-          <div class="col-lg-4">
-            <h5 class="fw-bold mt-2">Work</h5>
-            <ul style="margin:0">
-            <?php work(); ?>
-						</ul>
-					</div>
-          <div class="col-lg-4">
-            <h5 class="fw-bold mt-2">ToDo</h5>
-            <ul style="margin:0">
-            <?php todo(); ?>
-						</ul>
-					</div>
-          <div class="col-lg-4">
-            <h5 class="fw-bold mt-2">ToDo(ne)</h5>
-            <ul style="margin:0">
-            <?php todone(); ?>
-						</ul>
-					</div>
-        </div>
-        <div class="row mt-3">
-          <div class="col-lg-4">
-            <h5 class="fw-bold mt-2">Play</h5>
-            <ul style="margin:0">
-              <?php playing(); ?>
-						</ul>
-					</div>
-          <div class="col-lg-4">
-            <h5 class="fw-bold mt-2">Watch</h5>
-            <ul style="margin:0">
-            <?php watching(); ?>
-						</ul>
-					</div>
-          <div class="col-lg-4">
-            <h5 class="fw-bold mt-2">Listen</h5>
-            <ul style="margin:0 0 10px">
-            <?php listening(); ?>
-						</ul>
-            More @ <a href="/studio/music/">/studio/music/</a>
-					</div>
-				</div>
-        <div class="row mt-3 mb-5">
-          <div class="col-lg-4">
-            <h5 class="fw-bold mt-2">Read</h5>
-            <ul style="margin:0">
-            <?php reading(); ?>
-						</ul>
-					</div>
-          <div class="col-lg-4">
-            <h5 class="fw-bold mt-2">Learn</h5>
-            <ul style="margin:0">
-            <?php learning(); ?>
-						</ul>
-					</div>
-          <div class="col-lg-4">
-            <h5 class="fw-bold mt-2">Elsewhere</h5>
-            <p>I'll figure this out another hot weekend this summer. I'll use the ActivityPub spec through a self hosted solution. I also need to revisit commenting, pinging, liking, and sharing.
-            <ul style="margin:0">
-
 						</ul>
 					</div>
 				</div>

+ 9 - 4
style.css

@@ -1971,12 +1971,17 @@ span.author {
 .entry-content blockquote {
   border-left:none;
   font-style:italic;
-  font-size:.8em;
-	margin: 0 50px 20px;
+
+	margin: 0 0px 20px;
   color:#333;
-  background:#f1f1f1;
+  background:#eeeeeec7;
   padding:20px;
-  border-radius:20px;
+}
+blockquote p {
+  margin: 0 0 12px !important;
+}
+.wp-block-image figcaption {
+  display: block !important;
 }
 .entry-content blockquote cite {
   text-align:right;

File diff suppressed because it is too large
+ 0 - 0
v4-style.min.css


Some files were not shown because too many files changed in this diff