Browse Source

fix DOM parser for new TIL

windhamdavid 3 years ago
parent
commit
b8140e2dc5
1 changed files with 4 additions and 4 deletions
  1. 4 4
      inc/utils.php

+ 4 - 4
inc/utils.php

@@ -80,10 +80,10 @@ function _s_backbone_get_request_parameters() {
 function pull_til() {
 	include('lib/html_dom.php');
 
-	$url = 'https://davidawindham.com/til/til.html';
+	$url = 'https://davidawindham.com/til/index.html';
 	$html = file_get_html($url);
 	$i = 0;
-	foreach ($html->find('.markdown-section ul li ul li') as $li) {
+	foreach ($html->find('ul li ul li') as $li) {
 	    echo $li;
 		if (++$i == 17) break;
 	}
@@ -91,10 +91,10 @@ function pull_til() {
 function pull_til_all() {
 	include('lib/html_dom.php');
 
-	$url = 'https://davidawindham.com/til/til.html';
+	$url = 'https://davidawindham.com/til/index.html';
 	$html = file_get_html($url);
 	$i = 0;
-	foreach ($html->find('.markdown-section ul li ul li') as $li) {
+	foreach ($html->find('ul li ul li') as $li) {
 	    echo $li;
 	}
 }