Created
March 23, 2016 12:25
-
-
Save woodwardtw/fff04ea68b269830bb65 to your computer and use it in GitHub Desktop.
gets me a list of all bookmarks tagged 'weekly' for the last week via the pinboard API. uses https://github.com/kijin/pinboard-api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'pinboard-api.php'; //https://github.com/kijin/pinboard-api | |
$pinboard = new PinboardAPI('USERNAME','PASSWORD'); | |
date_default_timezone_set('UTC'); | |
$date = date_create('now'); | |
$lastweek = date_sub($date, date_interval_create_from_date_string('7 days')); | |
$lastweek = date_format($date, 'Y-m-d'); | |
$weekly = $pinboard->get_all(null,null,'weekly', $lastweek,null); | |
//var_dump($weekly); | |
echo '<ul>'; | |
foreach ($weekly as $bookmark) { | |
echo '<li><a href="' . $bookmark->url . '">' . $bookmark->title . '</a><br>' ; | |
echo '<blockquote>' . $bookmark->description . '</blockquote></li>'; | |
// echo implode(' ',$bookmark->tags) . " => " . "</li>"; | |
sleep(3); // honor API rate limit | |
} | |
echo '</ul>'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment