Skip to content

Instantly share code, notes, and snippets.

Created Dec 29, 2021
What would you like to do?
Quick script to count number of bookmarks recorded in pinboard
require 'dotenv/load'
require 'pinboard'
require 'csv'
pinboard = => ENV["PINBOARD_TOKEN"])"stats.csv", "w") do |csv|
csv << ["YEAR", "POSTS", "VIA_POCKET"]
#I started social bookmarking in 2004 using, then pinboard from May 2013
#started logging read articles in Pocket to pinboard via IFTTT in mid-2018
(2004..2021).each do |year|
posts_for_year = pinboard.posts(fromdt:,1,1), todt:,12,31))
posts_from_pocket = pinboard.posts(fromdt:,1,1), todt:,12,31), tag: 'Pocket')
csv << [year,posts_for_year.count, posts_from_pocket.count]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment