Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
gets me a list of all bookmarks tagged 'weekly' for the last week via the pinboard API. uses https://github.com/kijin/pinboard-api
<?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
You can’t perform that action at this time.