refresh-pinboard-errors
change
commit f5156d5f5f91adc5c6b8837cf4130541e0db9062
author Alpha Chen <alpha@kejadlen.dev>
date
parent 9aef5766
diff --git a/pinboard/.ruby-version b/pinboard/.ruby-version
new file mode 100644
index 0000000..1effb00
--- /dev/null
+++ b/pinboard/.ruby-version
@@ -0,0 +1 @@
+2.7
diff --git a/pinboard/Gemfile b/pinboard/Gemfile
deleted file mode 100644
index d946703..0000000
--- a/pinboard/Gemfile
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-gem "capybara"
-gem "minitest"
-gem "pry"
-gem "rake"
-gem "selenium-webdriver"
diff --git a/pinboard/Gemfile.lock b/pinboard/Gemfile.lock
deleted file mode 100644
index f719a92..0000000
--- a/pinboard/Gemfile.lock
+++ /dev/null
@@ -1,49 +0,0 @@
-GEM
-  remote: https://rubygems.org/
-  specs:
-    addressable (2.7.0)
-      public_suffix (>= 2.0.2, < 5.0)
-    capybara (3.33.0)
-      addressable
-      mini_mime (>= 0.1.3)
-      nokogiri (~> 1.8)
-      rack (>= 1.6.0)
-      rack-test (>= 0.6.3)
-      regexp_parser (~> 1.5)
-      xpath (~> 3.2)
-    childprocess (3.0.0)
-    coderay (1.1.3)
-    method_source (1.0.0)
-    mini_mime (1.0.2)
-    mini_portile2 (2.4.0)
-    minitest (5.14.1)
-    nokogiri (1.10.10)
-      mini_portile2 (~> 2.4.0)
-    pry (0.13.1)
-      coderay (~> 1.1)
-      method_source (~> 1.0)
-    public_suffix (4.0.5)
-    rack (2.2.3)
-    rack-test (1.1.0)
-      rack (>= 1.0, < 3)
-    rake (13.0.1)
-    regexp_parser (1.7.1)
-    rubyzip (2.3.0)
-    selenium-webdriver (3.142.7)
-      childprocess (>= 0.5, < 4.0)
-      rubyzip (>= 1.2.2)
-    xpath (3.2.0)
-      nokogiri (~> 1.8)
-
-PLATFORMS
-  ruby
-
-DEPENDENCIES
-  capybara
-  minitest
-  pry
-  rake
-  selenium-webdriver
-
-BUNDLED WITH
-   2.1.4
diff --git a/pinboard/refresh-pinboard-500s.rb b/pinboard/refresh-pinboard-errors.rb
similarity index 59%
rename from pinboard/refresh-pinboard-500s.rb
rename to pinboard/refresh-pinboard-errors.rb
index c296e26..7762ea2 100755
--- a/pinboard/refresh-pinboard-500s.rb
+++ b/pinboard/refresh-pinboard-errors.rb
@@ -1,13 +1,13 @@
 #!/usr/bin/env ruby
 
-# require "bundler/inline"
+require "bundler/inline"
 
-# gemfile do
-#   source "https://rubygems.org"
-#   gem "capybara"
-# end
-
-require "bundler/setup"
+gemfile do
+  source "https://rubygems.org"
+  gem "capybara"
+  gem "pry"
+  gem "selenium-webdriver"
+end
 
 def suppress_warnings
   original_verbosity = $VERBOSE
@@ -35,8 +35,18 @@ fill_in "username", with: ENV.fetch("PINBOARD_USERNAME")
 fill_in "password", with: ENV.fetch("PINBOARD_PASSWORD")
 click_button "log in"
 
+visit "https://pinboard.in/u:kejadlen/code:400"
+
+all(:xpath, "//a[@title='Click to re-crawl this link']").each do |link|
+  bookmark = link.find(:xpath, "../a[starts-with(@class, 'bookmark_title')]")
+  puts "Re-crawling #{bookmark.text}"
+  link.click
+end
+
 visit "https://pinboard.in/u:kejadlen/code:500"
 
 all(:xpath, "//a[@title='Click to re-crawl this link']").each do |link|
+  bookmark = link.find(:xpath, "../a[starts-with(@class, 'bookmark_title')]")
+  puts "Re-crawling #{bookmark.text}"
   link.click
 end