Browse Source

now page ⏰

windhamdavid 10 months ago
parent
commit
d3c5ecf032
2 changed files with 54 additions and 13 deletions
  1. 41 2
      inc/utils.php
  2. 13 11
      page-now.php

+ 41 - 2
inc/utils.php

@@ -160,6 +160,19 @@ function photo() {
     }
   }
 }
+function work() {
+	require_once('lib/html_dom.php');
+
+	$url = 'https://davidawindham.com/til/notes/work';
+	$html = file_get_html($url);
+	$i = 0;
+	foreach ($html->find('.markdown ul li') as $li) {
+    if (!empty($html)) {
+      echo $li;
+      if (++$i == 3) break;
+    }
+  }
+}
 function todo() {
 	require_once('lib/html_dom.php');
 
@@ -168,8 +181,21 @@ function todo() {
 	$i = 0;
 	foreach ($html->find('.markdown ul li') as $li) {
     if (!empty($html)) {
-      echo $li->childNodes(0);
-      if (++$i == 9) break;
+      echo $li;
+      if (++$i == 3) break;
+    }
+  }
+}
+function todone() {
+	require_once('lib/html_dom.php');
+
+	$url = 'https://davidawindham.com/til/lists/todone';
+	$html = file_get_html($url);
+	$i = 0;
+	foreach ($html->find('.markdown ul li') as $li) {
+    if (!empty($html)) {
+      echo $li;
+      if (++$i == 3) break;
     }
   }
 }
@@ -289,6 +315,19 @@ function reading() {
 		}
 	}
 }
+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;
+		}
+	}
+}
 function playing() {
 	require_once('lib/html_dom.php');
 

+ 13 - 11
page-now.php

@@ -15,12 +15,13 @@ get_header(); ?>
 			<div class="entry-content">
 				<div class="row mt-3">
           <div class="col-lg-7">
-            <p class="fs-5 lh-base"><span class="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. It's pulled in from various public things I keep notes on. Since I'm already working in a text editor, I've developed a habit of making markdown and text files which I just sync a set of files to a server and viola, it's here. It started with my notes and has expanded to menial things like my grocery lists because they fit right into my day to day workflow. My favorite list here is <b><i>ToDo(ne)</i></b>.</p>
+            <p class="fs-5 mb-3 lh-base"><span class="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 notes. I've developed a habit of making markdown and text files which I just sync a set of files to a server and viola, it's here. It started with my notes and has expanded to menial things like my grocery lists because they fit right into my workflow. My favorite list here is <b><i>ToDo(ne)</i></b>.</p>
+            <p><b>23/07/17</b> - I made this page because ig 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>
           </div>
           <div class="col-lg-4 offset-1">
 						<h5 class="fw-bold mt-2">Posts</h5>
 						<ul style="margin:0">
-							<?php $recentposts = get_posts(array( 'numberposts' => 9, 'offset' => 0 ) ); foreach ($recentposts as $post) : setup_postdata($post); ?>
+							<?php $recentposts = get_posts(array( 'numberposts' => 11, 'offset' => 0 ) ); foreach ($recentposts as $post) : setup_postdata($post); ?>
 							       <li style="color:#777"><?php echo get_the_date('y/m/d'); ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
 							<?php endforeach; ?>
 						</ul>
@@ -72,7 +73,7 @@ get_header(); ?>
           <div class="col-lg-4">
             <h5 class="fw-bold mt-2">Work</h5>
             <ul style="margin:0">
-            <?php photo(); ?>
+            <?php work(); ?>
 						</ul>
 					</div>
           <div class="col-lg-4">
@@ -84,25 +85,25 @@ get_header(); ?>
           <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">Playing</h5>
+            <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">Watching</h5>
+            <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">Listening</h5>
+            <h5 class="fw-bold mt-2">Listen</h5>
             <ul style="margin:0 0 10px">
             <?php listening(); ?>
 						</ul>
@@ -111,19 +112,20 @@ get_header(); ?>
 				</div>
         <div class="row mt-3 mb-5">
           <div class="col-lg-4">
-            <h5 class="fw-bold mt-2">Reading</h5>
+            <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">Learning</h5>
+            <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>